public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Jeff Law <law@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PR target/25111] New patterns for m68k bit insns
Date: Tue, 20 Jun 2017 10:28:00 -0000	[thread overview]
Message-ID: <mvminjrc5s9.fsf@suse.de> (raw)
In-Reply-To: <mvmlgoodnj6.fsf@suse.de> (Andreas Schwab's message of "Mon, 19	Jun 2017 17:07:09 +0200")

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

  reply	other threads:[~2017-06-20 10:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-19 17:55 Jeff Law
2017-06-19 15:07 ` Andreas Schwab
2017-06-20 10:28   ` Andreas Schwab [this message]
2017-06-23  4:18     ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mvminjrc5s9.fsf@suse.de \
    --to=schwab@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).