Patchwork [rs6000] Fix PR target/50091

login
register
mail settings
Submitter Eric Botcazou
Date Sept. 6, 2011, 9:36 a.m.
Message ID <201109061136.26060.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/113519/
State New
Headers show

Comments

Eric Botcazou - Sept. 6, 2011, 9:36 a.m.
Hi,

this is a regression present on the mainline/4.6/4.5 branches.  I overlooked 
the -mregnames business when I changed the probe_stack pattern and, while 
this silently works on most platforms, this breaks on Darwin because of the 
awkward assembler.

Tested on PowerPC/Darwin by Iain and on PowerPC/Linux by me.  OK for mainline 
and the 4.6/4.5 branches?


2011-09-06  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.
Eric Botcazou - Sept. 17, 2011, 8:19 a.m.
> Tested on PowerPC/Darwin by Iain and on PowerPC/Linux by me.  OK for
> mainline and the 4.6/4.5 branches?
>
>
> 2011-09-06  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.

Ping for the patch: http://gcc.gnu.org/ml/gcc-patches/2011-09/msg00361.html

Thanks in advance.

Patch

Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c	(revision 178488)
+++ config/rs6000/rs6000.c	(working copy)
@@ -19303,7 +19303,8 @@  output_probe_stack_range (rtx reg1, rtx
   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: config/rs6000/rs6000.md
===================================================================
--- config/rs6000/rs6000.md	(revision 178488)
+++ config/rs6000/rs6000.md	(working copy)
@@ -13049,7 +13049,11 @@  (define_insn "probe_stack"
   [(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")])