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: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 14 Jan 2012 11:48:37 +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 #27 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-01-14 11:48:37 UTC ---
(In reply to comment #25)
> BTW what happens on i?86-linux-* with -fpic?
You haven't read #c17, right?
But if you want even further details:
Both x and y there have:
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
i.e. %ebx after these two insns doesn't contain some address within the
function,
but address of the _GLOBAL_OFFSET_TABLE_ symbol in the current shared library
or binary. So, there is no need to restore anything, as nonlocal goto can only
be from a nested function to a function within the same translation unit and
thus shared library or binary, thus they have the same %ebx value.