re PR tree-optimization/49712 (internal compiler error: in gen_lsm_tmp_name, at tree...
authorJakub Jelinek <jakub@redhat.com>
Tue, 12 Jul 2011 09:13:06 +0000 (11:13 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 12 Jul 2011 09:13:06 +0000 (11:13 +0200)
PR tree-optimization/49712
* tree-ssa-loop-im.c (gen_lsm_tmp_name): Handle TARGET_MEM_REF.

* gcc.c-torture/execute/pr49712.c: New test.

From-SVN: r176195

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr49712.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.c

index 7fb19da7596981a43ab7e345cc5719b5c1c873f5..2599e731729485100891fab05ae51a6280353de8 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/49712
+       * tree-ssa-loop-im.c (gen_lsm_tmp_name): Handle TARGET_MEM_REF.
+
 2011-07-11  Bernd Schmidt  <bernds@codesourcery.com>
 
        * genautomata.c (add_arc): Return void.  All callers changed.
index 7d50bd12f6a8cbfe6076d6131973ee3b5740d98b..88f61ccce5613601878c273cb6ad72cc9e803b8b 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/49712
+       * gcc.c-torture/execute/pr49712.c: New test.
+
 2011-07-11  Jason Merrill  <jason@redhat.com>
 
        PR c++/44609
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr49712.c b/gcc/testsuite/gcc.c-torture/execute/pr49712.c
new file mode 100644 (file)
index 0000000..b85887b
--- /dev/null
@@ -0,0 +1,28 @@
+/* PR tree-optimization/49712 */
+
+int a[2], b, c, d, e;
+
+void
+foo (int x, int y)
+{
+}
+
+int
+bar (void)
+{
+  int i;
+  for (; d <= 0; d = 1)
+    for (i = 0; i < 4; i++)
+      for (e = 0; e; e = 1)
+       ;
+  return 0;
+}
+
+int
+main ()
+{
+  for (b = 0; b < 2; b++)
+    while (c)
+      foo (a[b] = 0, bar ());
+  return 0;
+}
index 778edd49ff0ecca173d38175582f34bea85213ca..3a5608e484e38ef0bea1235c84d4635d3b834991 100644 (file)
@@ -1982,6 +1982,7 @@ gen_lsm_tmp_name (tree ref)
   switch (TREE_CODE (ref))
     {
     case MEM_REF:
+    case TARGET_MEM_REF:
       gen_lsm_tmp_name (TREE_OPERAND (ref, 0));
       lsm_tmp_name_add ("_");
       break;