re PR target/50091 (-fstack-check generates wrong assembly)
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 18 Sep 2011 22:00:52 +0000 (22:00 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 18 Sep 2011 22:00:52 +0000 (22:00 +0000)
PR target/50091
* config/rs6000/rs6000.md (probe_stack): Use explicit operand.
* config/rs6000/rs6000.c (output_probe_stack_range): Likewise.

Co-Authored-By: Iain Sandoe <developer@sandoe-acoustics.co.uk>
From-SVN: r178944

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

index 461840f..a7c7279 100644 (file)
@@ -1,3 +1,10 @@
+2011-09-18  Eric Botcazou  <ebotcazou@adacore.com>
+           Iain Sandoe  <developer@sandoe-acoustics.co.uk>
+
+       PR target/50091
+       * config/rs6000/rs6000.md (probe_stack): Use explicit operand.
+       * config/rs6000/rs6000.c (output_probe_stack_range): Likewise.
+
 2011-09-18  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/bmiintrin.h: Remove tmp.
index 1ab57e5..63c0f0c 100644 (file)
@@ -19303,7 +19303,8 @@ output_probe_stack_range (rtx reg1, rtx reg2)
   output_asm_insn ("{cal %0,%1(%0)|addi %0,%0,%1}", xops);
 
   /* Probe at TEST_ADDR and branch.  */
-  output_asm_insn ("{st|stw} 0,0(%0)", xops);
+  xops[1] = gen_rtx_REG (Pmode, 0);
+  output_asm_insn ("{st|stw} %1,0(%0)", xops);
   fprintf (asm_out_file, "\tb ");
   assemble_name_raw (asm_out_file, loop_lab);
   fputc ('\n', asm_out_file);
index 818456f..3db67a5 100644 (file)
   [(set (match_operand 0 "memory_operand" "=m")
         (unspec [(const_int 0)] UNSPEC_PROBE_STACK))]
   ""
-  "{st%U0%X0|stw%U0%X0} 0,%0"
+  "*
+{
+  operands[1] = gen_rtx_REG (Pmode, 0);
+  return \"{st%U0%X0|stw%U0%X0} %1,%0\";
+}"
   [(set_attr "type" "store")
    (set_attr "length" "4")])