re PR target/80970 (internal compiler error in find_reloads, at reload.c:4077)
authorAndreas Schwab <schwab@suse.de>
Tue, 20 Jun 2017 10:15:47 +0000 (10:15 +0000)
committerAndreas Schwab <schwab@gcc.gnu.org>
Tue, 20 Jun 2017 10:15:47 +0000 (10:15 +0000)
PR target/80970
* config/m68k/m68k.md (bsetdreg, bchgdreg, bclrdreg): Use "=d"
instead of "+d".

From-SVN: r249401

gcc/ChangeLog
gcc/config/m68k/m68k.md
gcc/testsuite/gcc.dg/torture/pr80970.c [new file with mode: 0644]

index 10434ed8b51e9ce8e7b1650ec2a5bf6b8142b904..7cb99a6d88dcf597d26c5ce3b8748fa3b343e4b6 100644 (file)
@@ -1,3 +1,9 @@
+2017-06-20  Andreas Schwab  <schwab@suse.de>
+
+       PR target/80970
+       * config/m68k/m68k.md (bsetdreg, bchgdreg, bclrdreg): Use "=d"
+       instead of "+d".
+
 2017-06-20  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
 
        * config/arm/arm-c.c (arm_cpu_builtins): New block to define
index 5bf6c92d3d55074dc0bfde3c2e014b9b9839f896..7933f8eb253270ef835167e4668be2d8ea47810e 100644 (file)
   [(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)))
   [(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)))
   [(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)))
diff --git a/gcc/testsuite/gcc.dg/torture/pr80970.c b/gcc/testsuite/gcc.dg/torture/pr80970.c
new file mode 100644 (file)
index 0000000..3b96b58
--- /dev/null
@@ -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;
+}