[Patch x86/darwin] fix PR51784 'PIC register not correctly preserved...'

Iain Sandoe iain@codesourcery.com
Fri Jul 19 14:06:00 GMT 2013


Hi Uros,

thanks for your reviews,

On 18 Jul 2013, at 12:39, Uros Bizjak wrote:

> On Thu, Jul 18, 2013 at 12:12 PM, Iain Sandoe <iain@codesourcery.com> wrote:
>> 
>> So, I think we have to use the define_insn_and_split, or am I still missing something?
> 
> Just a wild guess, do you also need "&& reload_completed" in the split
> condition?

good catch, thanks - this got cut erroneously from the last variant of the patch.

Fixed & re-tested on x86_64-darwin12 / x86_64-linux (both at m32 and m64) showing the expected progressions on darwin (and correct behaviour on linux for the shlib example).

OK for trunk?

Ok for open branches? (this is a wrong-code bug)

[N.B. No changes to the darwin-specific portions already approved by Mike]

thanks
Iain

gcc/

	PR target/51784
	* config/i386/i386.c (output_set_got) [TARGET_MACHO]: Adjust to emit a second label for
	nonlocal goto receivers. Don't output pic base labels unless we're producing PIC; mark
	that action unreachable().
	(ix86_save_reg): If the function contains a nonlocal label, save the PIC base reg.
	* config/darwin-protos.h (machopic_should_output_picbase_label): New.
	* gcc/config/darwin.c (emitted_pic_label_num): New GTY. 
	(update_pic_label_number_if_needed): New.
	(machopic_output_function_base_name): Adjust for nonlocal receiver case.
	(machopic_should_output_picbase_label): New.
	* config/i386/i386.md (enum unspecv): UNSPECV_NLGR: New.
	(nonlocal_goto_receiver): New insn and split.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PR51784-nested-diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130719/05b5014d/attachment.txt>


More information about the Gcc-patches mailing list