This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/51784] PIC register not correctly preserved in nested funcs / with non-local goto
- From: "iains at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 18 Jan 2012 13:47:36 +0000
- Subject: [Bug target/51784] PIC register not correctly preserved in nested funcs / with non-local goto
- Auto-submitted: auto-generated
- References: <bug-51784-4@http.gcc.gnu.org/bugzilla/>
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?