re PR rtl-optimization/8555 (ICE in gen_split_1231)
authorJakub Jelinek <jakub@redhat.com>
Wed, 5 Feb 2003 11:29:15 +0000 (12:29 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 5 Feb 2003 11:29:15 +0000 (12:29 +0100)
PR optimization/8555
* config/i386/i386.md (sse_mov?fcc split): Handle op2 == op3 case
instead of aborting.

* gcc.dg/20030204-1.c: New test.

From-SVN: r62438

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20030204-1.c [new file with mode: 0644]

index ee7f50da2cca15e52e260412a6d7f9910f040790..e01c74d72134e50e1bafea41a91a863c9421baf0 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR optimization/8555
+       * config/i386/i386.md (sse_mov?fcc split): Handle op2 == op3 case
+       instead of aborting.
+
 2003-02-04  Richard Henderson  <rth@redhat.com>
 
        * config/i386/i386.md (UNSPEC_BSF): Remove.
index ffb2153bf3bc5cd6aadba87fa47d9286ee5667bb..a1eb241d45e1037f6b8857e15b91e10006bc800f 100644 (file)
       op = simplify_gen_subreg (V2DFmode, operands[3], DFmode, 0);
       emit_insn (gen_sse2_unpcklpd (op, op, op));
     }
-  /* If op2 == op3, op3 will be clobbered before it is used.
-     This should be optimized out though.  */
+
+  /* If op2 == op3, op3 would be clobbered before it is used.  */
   if (operands_match_p (operands[2], operands[3]))
-    abort ();
+    {
+      emit_move_insn (operands[0], operands[2]);
+      DONE;
+    }
+
   PUT_MODE (operands[1], GET_MODE (operands[0]));
   if (operands_match_p (operands[0], operands[4]))
     operands[6] = operands[4], operands[7] = operands[2];
index 861cc283bba97e16e2887c6fa1c139d5c63296f6..4d553c6f3051c5a05126a23fba489f38ad00be6e 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-05  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/20030204-1.c: New test.
+
 2003-02-04  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/38
diff --git a/gcc/testsuite/gcc.dg/20030204-1.c b/gcc/testsuite/gcc.dg/20030204-1.c
new file mode 100644 (file)
index 0000000..e236e3a
--- /dev/null
@@ -0,0 +1,16 @@
+/* PR optimization/8555 */
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -funroll-loops" } */
+/* { dg-options "-march=pentium3 -O -ffast-math -funroll-loops" { target i?86-*-* } } */
+
+float foo (float *a, int i)
+{
+  int j;
+  float x = a[j = i - 1], y;
+
+  for (j = i; --j >= 0; )
+    if ((y = a[j]) > x)
+      x = y;
+
+  return x;
+}