public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: gcc-patches@gcc.gnu.org
Cc: dje.gcc@gmail.com, Segher Boessenkool <segher@kernel.crashing.org>
Subject: [PATCH] rs6000: Fix PR67045
Date: Thu, 30 Jul 2015 05:09:00 -0000	[thread overview]
Message-ID: <911c5351f00cd9717b6aecb2c683e3ed34ceaaf9.1438217378.git.segher@kernel.crashing.org> (raw)

Paper bag time.  Committing as obvious fix.  Bootstrapped and regression
checked on powerpc64-linux and powerpc64le-linux; also bootstrapped the
latter with --enable-checking=release and -O3 (the PR67045 case).  Will
do an --enable-checking=yes,rtl as well.


Segher


2015-07-29  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/66217
	PR target/67045
	* config/rs6000/rs6000.md (and<mode>3): Put a CONST_INT_P check
	around those cases that need one.

---
 gcc/config/rs6000/rs6000.md | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index f7fa399..527ad98 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -2898,26 +2898,29 @@ (define_expand "and<mode>3"
       DONE;
     }
 
-  if (rs6000_is_valid_and_mask (operands[2], <MODE>mode))
+  if (CONST_INT_P (operands[2]))
     {
-      emit_insn (gen_and<mode>3_mask (operands[0], operands[1], operands[2]));
-      DONE;
-    }
+      if (rs6000_is_valid_and_mask (operands[2], <MODE>mode))
+	{
+	  emit_insn (gen_and<mode>3_mask (operands[0], operands[1], operands[2]));
+	  DONE;
+	}
 
-  if (logical_const_operand (operands[2], <MODE>mode)
-      && rs6000_gen_cell_microcode)
-    {
-      emit_insn (gen_and<mode>3_imm (operands[0], operands[1], operands[2]));
-      DONE;
-    }
+      if (logical_const_operand (operands[2], <MODE>mode)
+	  && rs6000_gen_cell_microcode)
+	{
+	  emit_insn (gen_and<mode>3_imm (operands[0], operands[1], operands[2]));
+	  DONE;
+	}
 
-  if (rs6000_is_valid_2insn_and (operands[2], <MODE>mode))
-    {
-      rs6000_emit_2insn_and (<MODE>mode, operands, true, 0);
-      DONE;
-    }
+      if (rs6000_is_valid_2insn_and (operands[2], <MODE>mode))
+	{
+	  rs6000_emit_2insn_and (<MODE>mode, operands, true, 0);
+	  DONE;
+	}
 
-  operands[2] = force_reg (<MODE>mode, operands[2]);
+      operands[2] = force_reg (<MODE>mode, operands[2]);
+    }
 })
 
 
-- 
1.8.1.4

                 reply	other threads:[~2015-07-30  2:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=911c5351f00cd9717b6aecb2c683e3ed34ceaaf9.1438217378.git.segher@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).