]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/54327 (Segmentation fault in init_ggc)
authorRichard Guenther <rguenther@suse.de>
Mon, 20 Aug 2012 10:26:45 +0000 (10:26 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 20 Aug 2012 10:26:45 +0000 (10:26 +0000)
2012-08-20  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/54327
* gimple-fold.c (get_maxval_strlen): Do not walk use-def chains
if the use is registered for SSA update.

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

From-SVN: r190528

gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr54327.c [new file with mode: 0644]

index 04c1dfa6e48c411a9eb235c109aa17eb828dfe59..c33069a37d9cd25a5cad481d58ad7f82891e8a7a 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-20  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/54327
+       * gimple-fold.c (get_maxval_strlen): Do not walk use-def chains
+       if the use is registered for SSA update.
+
 2012-08-20  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/54321
index d708c80afa9ac748b227ce4142cf711faaa5bcda..19a259e774e7fd807c008d4490201fb36a5a67a9 100644 (file)
@@ -736,6 +736,11 @@ get_maxval_strlen (tree arg, tree *length, bitmap visited, int type)
       return true;
     }
 
+  /* If ARG is registered for SSA update we cannot look at its defining
+     statement.  */
+  if (name_registered_for_update_p (arg))
+    return false;
+
   /* If we were already here, break the infinite cycle.  */
   if (!bitmap_set_bit (visited, SSA_NAME_VERSION (arg)))
     return true;
index 3ef6c94f43da68d98d39c87bf8a62e00f7ca662e..ba0b5b2aa31651aaa7a86882d6e3d8a9a7dcf59c 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-20  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/54327
+       * gcc.dg/torture/pr54327.c: New testcase.
+
 2012-08-20  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/54321
diff --git a/gcc/testsuite/gcc.dg/torture/pr54327.c b/gcc/testsuite/gcc.dg/torture/pr54327.c
new file mode 100644 (file)
index 0000000..fe7499a
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+#include <string.h>
+#include <stdlib.h>
+void treathead ()
+{
+  char *a = ';' == '\0' ? : 0;
+  if (*a == '=')
+    {
+      while (*a == (*a == 0) || *a == '\'')
+       a++;
+      if (strlen (a) < 2)
+       abort ();
+    }
+}