diff mbox

[PR,target/25111] New patterns for m68k bit insns

Message ID mvminjrc5s9.fsf@suse.de
State New
Headers show

Commit Message

Andreas Schwab June 20, 2017, 10:28 a.m. UTC
Tested on m68k, installed on trunk and gcc-7 branch.

Andreas.

	PR target/80970
	* config/m68k/m68k.md (bsetdreg, bchgdreg, bclrdreg): Use "=d"
	instead of "+d".

Comments

Jeff Law June 23, 2017, 4:18 a.m. UTC | #1
On 06/20/2017 04:28 AM, Andreas Schwab wrote:
> Tested on m68k, installed on trunk and gcc-7 branch.
> 
> Andreas.
> 
> 	PR target/80970
> 	* config/m68k/m68k.md (bsetdreg, bchgdreg, bclrdreg): Use "=d"
> 	instead of "+d".
Thanks for taking care of this.  I've been buried in the land of stack
clash for the last few weeks.

jeff
diff mbox

Patch

Index: config/m68k/m68k.md
===================================================================
--- config/m68k/m68k.md	(revision 249400)
+++ config/m68k/m68k.md	(working copy)
@@ -5337,7 +5337,7 @@ 
   [(set_attr "type" "bitrw")])
 
 (define_insn "*bsetdreg"
-  [(set (match_operand:SI 0 "register_operand" "+d")
+  [(set (match_operand:SI 0 "register_operand" "=d")
 	(ior:SI (ashift:SI (const_int 1)
 			   (and:SI (match_operand:SI 1 "register_operand" "d")
 				   (const_int 31)))
@@ -5350,7 +5350,7 @@ 
   [(set_attr "type" "bitrw")])
 
 (define_insn "*bchgdreg"
-  [(set (match_operand:SI 0 "register_operand" "+d")
+  [(set (match_operand:SI 0 "register_operand" "=d")
 	(xor:SI (ashift:SI (const_int 1)
 			   (and:SI (match_operand:SI 1 "register_operand" "d")
 				   (const_int 31)))
@@ -5363,7 +5363,7 @@ 
   [(set_attr "type" "bitrw")])
 
 (define_insn "*bclrdreg"
-  [(set (match_operand:SI 0 "register_operand" "+d")
+  [(set (match_operand:SI 0 "register_operand" "=d")
 	(and:SI (rotate:SI (const_int -2)
 			   (and:SI (match_operand:SI 1 "register_operand" "d")
 				   (const_int 31)))
Index: testsuite/gcc.dg/torture/pr80970.c
===================================================================
--- testsuite/gcc.dg/torture/pr80970.c	(nonexistent)
+++ testsuite/gcc.dg/torture/pr80970.c	(working copy)
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+
+int a, b, c, d, e;
+void f ()
+{
+  long g, h;
+  if (c)
+    e = d;
+  g = d & 31;
+  h = 1 << g;
+  a = e | h;
+  b = a;
+}