This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc-4.3.0 and -fPIC flags fails?


Hi,
I suspect that the new gcc-4.3.0, in certain cases, does not support correctly the
positioning independent code flag (-fPIC).
I have generated a cross-compiler for m68k cpu and here is what I got for this example:
Cast from a float to a unit32.
...
float a;
uint32 b;
...
b = (uint32)a;
...


The code is compiled with these options:
%.o : %.c $(DEP) makefile
	$(CC) -msep-data -fPIC -c -mcpu32 -Wall -g -O3  $<

Here is the code after compilation concerning this cast:
    ...
     572:	2f05           	movel %d5,%sp@-
     574:	61ff 0000 18aa 	bsrl 1e20 <__fixunssfsi>
     57a:	2400           	movel %d0,%d2
    ...

We can see that at this stage gcc take in account the -fPIC flag (it uses a relative bsrl call).
Unfortunately, the analysis of the routine __fixunssfsi, shows that some
absolute calls remains (a couple of jsr !!!!). In the previous version of gcc (4.2.3)
the code generated was correct. Any remarks?
Regards
Edo.


00001e20 <__fixunssfsi>:
#undef MAX
#include <limits.h>

UWtype
__fixunssfSI (SFtype a)
{
    1e20:	4e56 0000      	linkw %fp,#0
    1e24:	2f02           	movel %d2,%sp@-
    1e26:	242e 0008      	movel %fp@(8),%d2
  if (a >= - (SFtype) Wtype_MIN)
    1e2a:	2f3c 4f00 0000 	movel #1325400064,%sp@-
    1e30:	2f02           	movel %d2,%sp@-
    1e32:	4eb9 0000 23e4 	jsr 23e4 <__gesf2>
    1e38:	508f           	addql #8,%sp
    1e3a:	4a80           	tstl %d0
    1e3c:	6c12           	bges 1e50 <__fixunssfsi+0x30>
    return (Wtype) (a + Wtype_MIN) - Wtype_MIN;
  return (Wtype) a;
    1e3e:	2f02           	movel %d2,%sp@-
    1e40:	4eb9 0000 23a4 	jsr 23a4 <__fixsfsi>
    1e46:	588f           	addql #4,%sp
}
    1e48:	242e fffc      	movel %fp@(-4),%d2
    1e4c:	4e5e           	unlk %fp
    1e4e:	4e75           	rts



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]