This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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".

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;
+}

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]