This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR target/25111] New patterns for m68k bit insns
- From: Andreas Schwab <schwab at suse dot de>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 Jun 2017 12:28:06 +0200
- Subject: Re: [PR target/25111] New patterns for m68k bit insns
- Authentication-results: sourceware.org; auth=none
- References: <9474d6d5-f806-9118-d69a-000d43f62a9e@redhat.com> <mvmlgoodnj6.fsf@suse.de>
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."