re PR rtl-optimization/26449 (ICE in loop invariant motion)
authorZdenek Dvorak <dvorakz@suse.cz>
Thu, 8 Jun 2006 08:17:05 +0000 (10:17 +0200)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Thu, 8 Jun 2006 08:17:05 +0000 (08:17 +0000)
PR rtl-optimization/26449
* loop-invariant.c (move_invariant_reg): Fail if force_operand fails.

* gcc.dg/pr26449.c: New test.

From-SVN: r114481

gcc/ChangeLog
gcc/loop-invariant.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr26449.c [new file with mode: 0644]

index 6a44f7d5bc04036a8bd2b8738609623e255a35ed..237393d8f12da9bc354d3e9937a8909a3e958f68 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-07  Zdenek Dvorak <dvorakz@suse.cz>
+
+       PR rtl-optimization/26449
+       * loop-invariant.c (move_invariant_reg): Fail if force_operand fails.
+
 2006-06-07  Andrew MacLeod  <amacleod@redhat.com>
 
        PR middle-end/27793
index 026af40822ceee6c83fcfcd9c549d40fcdfab03b..cf2294950153a2a519fc392fc43eb9175c4a9af6 100644 (file)
@@ -1178,6 +1178,11 @@ move_invariant_reg (struct loop *loop, unsigned invno)
        {
          start_sequence ();
          op = force_operand (SET_SRC (set), reg);
+         if (!op)
+           {
+             end_sequence ();
+             goto fail;
+           }
          if (op != reg)
            emit_move_insn (reg, op);
          seq = get_insns ();
index 3e0314552d938bd3d2637d0a608341ce638c923e..78cbebc233f9887892226f66c690fec55cd5bfee 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-07  Zdenek Dvorak <dvorakz@suse.cz>
+
+       PR rtl-optimization/26449
+       * gcc.dg/pr26449.c: New test.
+
 2006-06-07  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27601
diff --git a/gcc/testsuite/gcc.dg/pr26449.c b/gcc/testsuite/gcc.dg/pr26449.c
new file mode 100644 (file)
index 0000000..1a0bdad
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile { target i?86-*-* } } */
+/* { dg-options "-O1 -ftree-vectorize -march=pentium4 -std=c99" } */
+
+void matmul_i4 (int bbase_yn, int xcount)
+{
+  int x;
+  int * restrict dest_y;
+  const int * abase_n;
+
+  for (x = 0;  x < xcount;  x++)
+    {
+      dest_y[x] += abase_n[x] * bbase_yn; 
+    }
+}
+