This is the mail archive of the
mailing list for the GCC project.
Re: [Patch x86/darwin] fix PR51784 'PIC register not correctly preserved...'
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Iain Sandoe <iain at codesourcery dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>, Richard Henderson <rth at redhat dot com>
- Date: Thu, 18 Jul 2013 08:31:34 +0200
- Subject: Re: [Patch x86/darwin] fix PR51784 'PIC register not correctly preserved...'
> The PR is logged against Darwin, and (as Jakub points out in the PR thread) indeed Darwin is
> missing a nonlocal_goto_receiver to restore the PIC reg in code that uses it (most of the patch).
> However, there is a second issue, and (if I've understood things correctly) this affects GOT targets > too - thus there is a single non-darwin-specific hunk for which I need approval for X86 as a whole.
> PR target/51784
> * config/i386/i386.c (output_set_got, DARWIN): Adjust to emit a second label for nonlocal
You can write this as:
* config/i386/i386.c (output_set_got) [TARGET_MACHO]: ...
+ [(unspec_volatile [(const_int 0)] UNSPECV_NLGR)]
+ "TARGET_MACHO && !TARGET_64BIT && flag_pic"
This should be implemented as an expander. You also won't need
UNSPEC_NLGR that way.