Patchwork Fix ICE in gen_lsm_tmp_name (PR tree-optimization/49712)

login
register
mail settings
Submitter Jakub Jelinek
Date July 12, 2011, 9:16 a.m.
Message ID <20110712091624.GO2687@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/104330/
State New
Headers show

Comments

Jakub Jelinek - July 12, 2011, 9:16 a.m.
Hi!

Now that LIM is scheduled after IVOPTS too, it needs to be prepared to
handle TARGET_MEM_REFs IVOPTS creates.
Tested on x86_64-linux, committed to trunk as obvious.

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.

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


	Jakub

Patch

--- gcc/tree-ssa-loop-im.c.jj	2011-05-17 13:32:20.000000000 +0200
+++ gcc/tree-ssa-loop-im.c	2011-07-12 08:48:22.000000000 +0200
@@ -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;
--- gcc/testsuite/gcc.c-torture/execute/pr49712.c.jj	2011-07-12 08:52:12.000000000 +0200
+++ gcc/testsuite/gcc.c-torture/execute/pr49712.c	2011-07-12 08:51:44.000000000 +0200
@@ -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;
+}