re PR middle-end/54327 (Segmentation fault in init_ggc)

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
This commit is contained in:
Richard Guenther 2012-08-20 10:26:45 +00:00 committed by Richard Biener
parent 081db96050
commit 491e0b9b0c
4 changed files with 31 additions and 0 deletions

View 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

View 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;

View 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

View File

@ -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 ();
}
}