This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Strange PIC code on ia32 since Aug. 29.
On Sep 2, 2000, "H . J . Lu" <hjl@valinux.com> wrote:
> On Fri, Sep 01, 2000 at 11:38:04PM -0300, Alexandre Oliva wrote:
>> On Sep 1, 2000, "H . J . Lu" <hjl@valinux.com> wrote:
>>
>> > call bar@PLT
>>
>> > It doesn't look like PIC code at all.
>>
>> Why not? IIRC, both `call' and `@PLT' are PC-relative on ia32.
> Study psABI says about PIC and what the previous gcc generates. I am
> enlosing the correct asm output here. gcc shouldn't output some random
> asm code and call it PIC. Did you see the difference?
I do. The difference is that GCC ``needlessly'' saves and initializes
%ebx. Unfortunately, this is necessary because the PLT code relies on
%ebx being set.
Which reminds me of the reason why I had initially set
current_function_uses_pic_offset_table to 1 in the `symPLT_label2reg'
define_expand in sh.md :-)
I recall having seen a patch to optimize PIC calling sequences on
i?86, but I can't find the corresponding ChangeLog entry :-(
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me