public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386]: Fix PR50464, ICE with blendv insn
@ 2011-09-22 18:19 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2011-09-22 18:19 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

Hello!

2011-09-22  Uros Bizjak  <ubizjak@gmail.com>

	PR target/50482
	* config/i386/i386.c (ix86_expand_sse_movcc): When generating
	blendv, force op_true to register if it doesn't satisfy
	nonimmediate_operand predicate.

testsuite/ChangeLog:

2011-09-22  Uros Bizjak  <ubizjak@gmail.com>

	PR target/50482
	* gcc.target/i386/pr50482.c: New test.

Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 932 bytes --]

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 179091)
+++ config/i386/i386.c	(working copy)
@@ -18911,6 +18911,9 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_t
     {
       rtx (*gen) (rtx, rtx, rtx, rtx) = NULL;
 
+      if (!nonimmediate_operand (op_true, mode))
+	op_true = force_reg (mode, op_true);
+
       op_false = force_reg (mode, op_false);
 
       switch (mode)
Index: testsuite/gcc.target/i386/pr50482.c
===================================================================
--- testsuite/gcc.target/i386/pr50482.c	(revision 0)
+++ testsuite/gcc.target/i386/pr50482.c	(revision 0)
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msse4" } */
+
+void
+test (int code, unsigned int * image, int * colors)
+{
+  int i;
+
+  for (i = 0; i < code; ++i)
+    image[i] = (colors[i] < 0 ? ~(unsigned int) 0 : colors[i]);
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-22 17:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-22 18:19 [PATCH, i386]: Fix PR50464, ICE with blendv insn Uros Bizjak

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