------- Additional Comments From amodra at bigpond dot net dot au 2004-11-10 05:07 ------- I made the following reply the day after I said I'd poke around. Somehow it seems to be missing from the gcc-patches archive. Anyway, here it is again:
I grepped through the entire slackware linux source base for occurrences of __PIC__, and found that all those that might affect PowerPC64 were testing for (b). There were only three occurrences, all in glibc! Many more for x86 which I didn't pay much attention to, but the few I did look at were actually testing for (a). This isn't so surprising, since on x86 we want different assembly for PIC code, regardless of whether PIC code is for shared libs (most likely) or otherwise. OTOH, the only sensible test of __PIC__ on PowerPC64 can be for (b), since we are (a) all the time. Because we currently define __PIC__ all the time, the three occurrences affecting PowerPC64 Linux result in missed optimizations for non-shared lib code. This suggests that powerpc64-linux-gcc should only define __PIC__ when -fPIC is given, and that Kaveh's patch is OK. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6123