From: Alan Modra Date: Fri, 31 Jul 2015 14:05:42 +0000 (+0930) Subject: re PR go/66870 (split stack issues on ppc64le and ppc64) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9b015c36906089cfbea506d45995350b718bee4a;p=gcc.git re PR go/66870 (split stack issues on ppc64le and ppc64) PR target/66870 * config/rs6000/rs6000.c (machine_function): Add split_stack_argp_used. (rs6000_emit_prologue): Set it. (rs6000_set_up_by_prologue): Specify r12 when split_stack_argp_used. From-SVN: r226443 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6163e023e28..daddd9aff2c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-07-31 Alan Modra + + PR target/66870 + * config/rs6000/rs6000.c (machine_function): Add split_stack_argp_used. + (rs6000_emit_prologue): Set it. + (rs6000_set_up_by_prologue): Specify r12 when split_stack_argp_used. + 2015-07-31 Richard Biener * fold-const.c (fold_binary_loc): Remove X ^ C1 == C2 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2313fad09d9..78de6452feb 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -166,6 +166,7 @@ typedef struct GTY(()) machine_function rtx sdmode_stack_slot; /* Alternative internal arg pointer for -fsplit-stack. */ rtx split_stack_arg_pointer; + bool split_stack_argp_used; /* Flag if r2 setup is needed with ELFv2 ABI. */ bool r2_setup_needed; } machine_function; @@ -24693,6 +24694,7 @@ rs6000_emit_prologue (void) __morestack was called, it left the arg pointer to the old stack in r29. Otherwise, the arg pointer is the top of the current frame. */ + cfun->machine->split_stack_argp_used = true; if (sp_adjust) { rtx r12 = gen_rtx_REG (Pmode, 12); @@ -33930,6 +33932,8 @@ rs6000_set_up_by_prologue (struct hard_reg_set_container *set) && TARGET_MINIMAL_TOC && get_pool_size () != 0) add_to_hard_reg_set (&set->set, Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM); + if (cfun->machine->split_stack_argp_used) + add_to_hard_reg_set (&set->set, Pmode, 12); }