[Bug target/51784] PIC register not correctly preserved in nested funcs / with non-local goto
iains at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 18 14:25:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51784
--- Comment #36 from Iain Sandoe <iains at gcc dot gnu.org> 2012-01-18 13:47:36 UTC ---
(In reply to comment #34)
> 5) to determine if you need to load the pic register or not, you should match
> what
> the prologue expansion does, try
> (pic_offset_table_rtx
> && (df_regs_ever_live_p (REAL_PIC_OFFSET_TABLE_REGNUM)
> || crtl->profile))
nothing seems to use df_regs_ever_live_p in the md files, and the function is
not visible. I also wonder if it is updated during RTL optimization?
(I tried making a function in i386.c that performed these tests and was visible
from the md - but it didn't work).
For now, I've used crtl->uses_pic_offset_table which seems to work.
Is there any other suggestion?
> probably also anded with && !current_function_is_leaf - non-local goto receiver
> in leaf functions doesn't make much sense and certainly doesn't need to restore
> PIC pointer, plus it will simplify it (for leaf functions we sometimes decide
> to use a different register as pic pointer instead of %ebx).
hopefully using pic_offset_table_rtx will pick up the current one?
More information about the Gcc-bugs
mailing list