rs6000.c (split_stack_arg_pointer_used_p): Scan correct block for use of r12.
authorAlan Modra <amodra@gmail.com>
Sat, 30 May 2015 00:15:30 +0000 (09:45 +0930)
committerAlan Modra <amodra@gcc.gnu.org>
Sat, 30 May 2015 00:15:30 +0000 (09:45 +0930)
* config/rs6000/rs6000.c (split_stack_arg_pointer_used_p): Scan
correct block for use of r12.
(rs6000_expand_split_stack_prologue): Error on r29 asm global reg.

From-SVN: r223878

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

index 1d5989831a3e9e49ebd3ae4503ee96e84708c1b5..063362d24d1553d0364114fa524cab6358ae37b6 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-30  Alan Modra  <amodra@gmail.com>
+
+       * config/rs6000/rs6000.c (split_stack_arg_pointer_used_p): Scan
+       correct block for use of r12.
+       (rs6000_expand_split_stack_prologue): Error on r29 asm global reg.
+
 2015-05-29  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
        PR target/66215
index a590ef4dae41dbaf8ae777c8bee50aba3ccfc619..1201c8672aef962de952c31704f38871283235b9 100644 (file)
@@ -23450,7 +23450,7 @@ split_stack_arg_pointer_used_p (void)
   /* Unfortunately we also need to do some code scanning, since
      r12 may have been substituted for the pseudo.  */
   rtx_insn *insn;
-  basic_block bb = ENTRY_BLOCK_PTR_FOR_FN (cfun);
+  basic_block bb = ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb;
   FOR_BB_INSNS (bb, insn)
     if (NONDEBUG_INSN_P (insn))
       {
@@ -25942,6 +25942,13 @@ rs6000_expand_split_stack_prologue (void)
   if (!info->push_p)
     return;
 
+  if (global_regs[29])
+    {
+      error ("-fsplit-stack uses register r29");
+      inform (DECL_SOURCE_LOCATION (global_regs_decl[29]),
+             "conflicts with %qD", global_regs_decl[29]);
+    }
+
   allocate = info->total_size;
   if (allocate > (unsigned HOST_WIDE_INT) 1 << 31)
     {