From 3903f804302c66b3e06238799577a36cfe403a42 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sun, 18 Sep 2011 22:00:52 +0000 Subject: [PATCH] re PR target/50091 (-fstack-check generates wrong assembly) 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 From-SVN: r178944 --- gcc/ChangeLog | 7 +++++++ gcc/config/rs6000/rs6000.c | 3 ++- gcc/config/rs6000/rs6000.md | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 461840f52da..a7c72791acb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-09-18 Eric Botcazou + Iain Sandoe + + 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 * config/i386/bmiintrin.h: Remove tmp. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 1ab57e5363a..63c0f0ce201 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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); diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 818456f4193..3db67a53248 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -13049,7 +13049,11 @@ [(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")]) -- 2.30.2