diff mbox

[4/6] rs6000: Fix stack probes for -m32 -mpowerpc64

Message ID 726299fb66ec01967f3404ea2410026a3c0558a5.1421482716.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool Jan. 17, 2015, 8:48 a.m. UTC
This fixes 3 FAILs.

The generic emit_stack_probe (that is used for probe_stack patterns) uses
word_mode, which won't fly for -m32 -mpowerpc64.  Use probe_stack_address
instead, and create the MEM by hand.


2015-01-16  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/
	* config/rs6000/rs6000.md (probe_stack): Delete.
	(probe_stack_address): New.

---
 gcc/config/rs6000/rs6000.md | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

David Edelsohn Jan. 17, 2015, 2:32 p.m. UTC | #1
On Sat, Jan 17, 2015 at 3:48 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> This fixes 3 FAILs.
>
> The generic emit_stack_probe (that is used for probe_stack patterns) uses
> word_mode, which won't fly for -m32 -mpowerpc64.  Use probe_stack_address
> instead, and create the MEM by hand.
>
>
> 2015-01-16  Segher Boessenkool  <segher@kernel.crashing.org>
>
> gcc/
>         * config/rs6000/rs6000.md (probe_stack): Delete.
>         (probe_stack_address): New.

Okay.

Thanks, David
diff mbox

Patch

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index a97cc1d..570d28f 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -11691,11 +11691,13 @@  (define_insn "blockage"
   ""
   "")
 
-(define_expand "probe_stack"
-  [(set (match_operand 0 "memory_operand" "=m")
-        (unspec [(const_int 0)] UNSPEC_PROBE_STACK))]
+(define_expand "probe_stack_address"
+  [(use (match_operand 0 "address_operand"))]
   ""
 {
+  operands[0] = gen_rtx_MEM (Pmode, operands[0]);
+  MEM_VOLATILE_P (operands[0]) = 1;
+
   if (TARGET_64BIT)
     emit_insn (gen_probe_stack_di (operands[0]));
   else
-- 
1.8.1.4






---
 gcc/config/rs6000/rs6000.md | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index a97cc1d..570d28f 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -11691,11 +11691,12 @@  (define_insn "blockage"
   ""
   "")
 
-(define_expand "probe_stack"
-  [(set (match_operand 0 "memory_operand" "=m")
-        (unspec [(const_int 0)] UNSPEC_PROBE_STACK))]
+(define_expand "probe_stack_address"
+  [(use (match_operand 0 "address_operand"))]
   ""
 {
+  operands[0] = gen_rtx_MEM (Pmode, operands[0]);
+
   if (TARGET_64BIT)
     emit_insn (gen_probe_stack_di (operands[0]));
   else