re PR go/66870 (split stack issues on ppc64le and ppc64)
authorLynn Boger <laboger@linux.vnet.ibm.com>
Wed, 5 Aug 2015 18:07:16 +0000 (13:07 -0500)
committerLynn Boger <boger@gcc.gnu.org>
Wed, 5 Aug 2015 18:07:16 +0000 (13:07 -0500)
2015-08-15 Lynn Boger <laboger@linux.vnet.ibm.com>

PR target/66870
* gcc/config/rs6000/rs6000.c (rs6000_emit_prologue): Check
for no_split_stack function attribute along with
flag_split_stack.
(rs6000_expand_split_stack_prologue): Likewise.

From-SVN: r226643

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index c29e1c6e4da0672925862fb603cab188f6975f52..81a1430160a69ebf10e783c179ddc18f14e3b892 100644 (file)
@@ -1,3 +1,11 @@
+2015-08-05  Lynn Boger  <laboger@linux.vnet.ibm.com>
+
+       PR target/66870
+       * gcc/config/rs6000/rs6000.c (rs6000_emit_prologue): Check
+       for no_split_stack function attribute along with
+       flag_split_stack.
+       (rs6000_expand_split_stack_prologue): Likewise.
+
 2015-08-05  Manuel López-Ibáñez  <manu@gcc.gnu.org>
            Jeff Law  <law@redhat.com>
 
index bcd0cd074c10b3fc44bcf8aadd4d6ea9b829eb6d..e37ef9fdad5d8537cffffe5f3366fc7f874a6ed2 100644 (file)
@@ -23748,6 +23748,11 @@ rs6000_emit_prologue (void)
   int using_static_chain_p = (cfun->static_chain_decl != NULL_TREE
                              && df_regs_ever_live_p (STATIC_CHAIN_REGNUM)
                              && call_used_regs[STATIC_CHAIN_REGNUM]);
+  int using_split_stack = (flag_split_stack
+                           && (lookup_attribute ("no_split_stack",
+                                                 DECL_ATTRIBUTES (cfun->decl))
+                               == NULL));
   /* Offset to top of frame for frame_reg and sp respectively.  */
   HOST_WIDE_INT frame_off = 0;
   HOST_WIDE_INT sp_off = 0;
@@ -24018,7 +24023,7 @@ rs6000_emit_prologue (void)
       && info->cr_save_p
       && REGNO (frame_reg_rtx) != cr_save_regno
       && !(using_static_chain_p && cr_save_regno == 11)
-      && !(flag_split_stack && cr_save_regno == 12 && sp_adjust))
+      && !(using_split_stack && cr_save_regno == 12 && sp_adjust))
     {
       cr_save_rtx = gen_rtx_REG (SImode, cr_save_regno);
       START_USE (cr_save_regno);
@@ -24596,7 +24601,7 @@ rs6000_emit_prologue (void)
       if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
          && !using_static_chain_p)
        save_regno = 11;
-      else if (flag_split_stack || REGNO (frame_reg_rtx) == 12)
+      else if (using_split_stack || REGNO (frame_reg_rtx) == 12)
        {
          save_regno = 11;
          if (using_static_chain_p)
@@ -24699,7 +24704,7 @@ rs6000_emit_prologue (void)
       emit_insn (gen_frame_store (reg, sp_reg_rtx, RS6000_TOC_SAVE_SLOT));
     }
 
-  if (flag_split_stack && split_stack_arg_pointer_used_p ())
+  if (using_split_stack && split_stack_arg_pointer_used_p ())
     {
       /* Set up the arg pointer (r12) for -fsplit-stack code.  If
         __morestack was called, it left the arg pointer to the old
@@ -26287,7 +26292,10 @@ rs6000_expand_split_stack_prologue (void)
 static rtx
 rs6000_internal_arg_pointer (void)
 {
-  if (flag_split_stack)
+  if (flag_split_stack
+     && (lookup_attribute ("no_split_stack", DECL_ATTRIBUTES (cfun->decl))
+         == NULL))
+
     {
       if (cfun->machine->split_stack_arg_pointer == NULL_RTX)
        {