re PR target/26600 (internal compiler error: in push_reload, at reload.c:1303)
authorRoger Sayle <roger@eyesopen.com>
Tue, 16 May 2006 04:16:00 +0000 (04:16 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 16 May 2006 04:16:00 +0000 (04:16 +0000)
PR target/26600
* config/i386/i386.c (legitimate_constant_p) <CONST_DOUBLE>: TImode
integer constants other than zero are only legitimate on TARGET_64BIT.
<CONST_VECTOR> Only zero vectors are legitimate.
(ix86_cannot_force_const_mem): Integral and vector constants can
always be put in the constant pool.

* gcc.target/i386/pr26600.c: New test case.

From-SVN: r113818

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr26600.c [new file with mode: 0644]

index f01eebdae816c02b75423e9843f6b626adf5485b..b4119862cd5e916a69ba4ca1bcdbdb9051a29453 100644 (file)
@@ -1,3 +1,12 @@
+2006-05-15  Roger Sayle  <roger@eyesopen.com>
+
+       PR target/26600
+       * config/i386/i386.c (legitimate_constant_p) <CONST_DOUBLE>: TImode
+       integer constants other than zero are only legitimate on TARGET_64BIT.
+       <CONST_VECTOR> Only zero vectors are legitimate.
+       (ix86_cannot_force_const_mem): Integral and vector constants can
+       always be put in the constant pool.
+
 2006-05-16  DJ Delorie  <dj@redhat.com>
 
        * crtstuff.c (__dso_handle): Set section from
index c81dee81152952973baf2bff76c5fbe482953896..3ff5abbd66cfcd595c16a0ec1c3cb1b5e548fd3d 100644 (file)
@@ -5934,6 +5934,18 @@ legitimate_constant_p (rtx x)
        return false;
       break;
 
+    case CONST_DOUBLE:
+      if (GET_MODE (x) == TImode
+         && x != CONST0_RTX (TImode)
+          && !TARGET_64BIT)
+       return false;
+      break;
+
+    case CONST_VECTOR:
+      if (x == CONST0_RTX (GET_MODE (x)))
+       return true;
+      return false;
+
     default:
       break;
     }
@@ -5949,6 +5961,17 @@ legitimate_constant_p (rtx x)
 static bool
 ix86_cannot_force_const_mem (rtx x)
 {
+  /* We can always put integral constants and vectors in memory.  */
+  switch (GET_CODE (x))
+    {
+    case CONST_INT:
+    case CONST_DOUBLE:
+    case CONST_VECTOR:
+      return false;
+
+    default:
+      break;
+    }
   return !legitimate_constant_p (x);
 }
 
index 529a209fa289686cd2a87f82356866d46a94816b..9f65c93f1af487fbae259cd695c3aabe0dc93140 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-15  Roger Sayle  <roger@eyesopen.com>
+
+       PR target/26600
+       * gcc.target/i386/pr26600.c: New test case.
+
 2006-05-15  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/27505
diff --git a/gcc/testsuite/gcc.target/i386/pr26600.c b/gcc/testsuite/gcc.target/i386/pr26600.c
new file mode 100644 (file)
index 0000000..bbe0663
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -msse2" } */
+
+void foo(int *p, int N)
+{
+    int i;
+    for (i=0; i<8; ++i, ++p)
+    {
+        int j = N+2*(N+p[0]), k = 2*N+p[0];
+        p[0] = j+N;
+        p[5] = j+k;
+    }
+}
+