]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/55687 (ICE in hide_evolution_in_other_loops_than_loop, at...
authorRichard Biener <rguenther@suse.de>
Fri, 14 Dec 2012 12:57:27 +0000 (12:57 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 14 Dec 2012 12:57:27 +0000 (12:57 +0000)
2012-12-14  Richard Biener  <rguenther@suse.de>

PR tree-optimization/55687
* tree-chrec.h (no_evolution_in_loop_p): Properly use
tree_contains_chrecs.

* gcc.dg/torture/pr55687.c: New testcase.

From-SVN: r194498

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr55687.c [new file with mode: 0644]
gcc/tree-chrec.h

index 0dbf2032f6f678a3d985fb8b101eeaa0a649f3ed..0f5b0af6861a530833fbaad1e3332bc71a00cabb 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-14  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/55687
+       * tree-chrec.h (no_evolution_in_loop_p): Properly use
+       tree_contains_chrecs.
+
 2012-12-13  Richard Henderson  <rth@redhat.com>
 
        PR middle-end/55492
index e16352a38122df8a28910facf340ea7616ed7565..c8578bf465b7c065eaf3d5a98918eb3ab4f56e01 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-14  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/55687
+       * gcc.dg/torture/pr55687.c: New testcase.
+
 2012-12-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/55652
diff --git a/gcc/testsuite/gcc.dg/torture/pr55687.c b/gcc/testsuite/gcc.dg/torture/pr55687.c
new file mode 100644 (file)
index 0000000..1eab1a4
--- /dev/null
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+typedef struct _IO_FILE FILE;
+typedef short gshort;
+typedef struct _GString GString;
+
+extern char *fgets(char *, int, FILE *);
+
+void verbose_text_loop (void *data)
+{
+  FILE *dev_vcs;
+  char buf[81];
+  GString *buf_str;
+  gshort i, j;
+  while (1)      
+    {
+      for (i = 1; i <= 7; i++)
+       {
+         while (fgets (buf, 81, dev_vcs))
+           {
+             for (j = 0;   j < __builtin_strlen (buf);   j++)
+               if (buf[j] != ' ')    
+                 break;   
+             for (;   j < __builtin_strlen (buf);   j++)
+               g_string_append_c_inline (buf_str, buf[j]); 
+           }
+       }
+    }
+}
index 6d61d5fa8ea48827fef7c2be81f99d416f9f9207..db3f3bfe8ccf27b04c8088d8d00128533d1a7599 100644 (file)
@@ -117,7 +117,7 @@ no_evolution_in_loop_p (tree chrec, unsigned loop_num, bool *res)
 
   STRIP_NOPS (chrec);
   scev = hide_evolution_in_other_loops_than_loop (chrec, loop_num);
-  *res = !tree_is_chrec (scev);
+  *res = !tree_contains_chrecs (scev, NULL);
   return true;
 }