Commit b3b30b24 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/38445 (ICE in tree-ssa-struct-alias when compiling grub-0.97)

2008-12-09  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/38445
	* tree-ssa-structalias.c (emit_pointer_definition): Only visit
	names once.
	(emit_alias_warning): Adjust.

From-SVN: r142590
parent 30da6111
2008-12-09 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38445
* tree-ssa-structalias.c (emit_pointer_definition): Only visit
names once.
(emit_alias_warning): Adjust.
2008-12-09 Andrew Haley <aph@redhat.com> 2008-12-09 Andrew Haley <aph@redhat.com>
* fixed-value.c (do_fixed_add): Add comment. * fixed-value.c (do_fixed_add): Add comment.
...@@ -4704,8 +4704,9 @@ static bool have_alias_info = false; ...@@ -4704,8 +4704,9 @@ static bool have_alias_info = false;
/* Emit a note for the pointer initialization point DEF. */ /* Emit a note for the pointer initialization point DEF. */
static void static void
emit_pointer_definition (gimple def) emit_pointer_definition (tree ptr, bitmap visited)
{ {
gimple def = SSA_NAME_DEF_STMT (ptr);
if (gimple_code (def) == GIMPLE_PHI) if (gimple_code (def) == GIMPLE_PHI)
{ {
use_operand_p argp; use_operand_p argp;
...@@ -4715,7 +4716,10 @@ emit_pointer_definition (gimple def) ...@@ -4715,7 +4716,10 @@ emit_pointer_definition (gimple def)
{ {
tree arg = USE_FROM_PTR (argp); tree arg = USE_FROM_PTR (argp);
if (TREE_CODE (arg) == SSA_NAME) if (TREE_CODE (arg) == SSA_NAME)
emit_pointer_definition (SSA_NAME_DEF_STMT (arg)); {
if (bitmap_set_bit (visited, SSA_NAME_VERSION (arg)))
emit_pointer_definition (arg, visited);
}
else else
inform (0, "initialized from %qE", arg); inform (0, "initialized from %qE", arg);
} }
...@@ -4729,7 +4733,6 @@ emit_pointer_definition (gimple def) ...@@ -4729,7 +4733,6 @@ emit_pointer_definition (gimple def)
static void static void
emit_alias_warning (tree ptr) emit_alias_warning (tree ptr)
{ {
gimple def = SSA_NAME_DEF_STMT (ptr);
gimple use; gimple use;
imm_use_iterator ui; imm_use_iterator ui;
unsigned warned = 0; unsigned warned = 0;
...@@ -4777,7 +4780,11 @@ emit_alias_warning (tree ptr) ...@@ -4777,7 +4780,11 @@ emit_alias_warning (tree ptr)
} }
} }
if (warned > 0) if (warned > 0)
emit_pointer_definition (def); {
bitmap visited = BITMAP_ALLOC (NULL);
emit_pointer_definition (ptr, visited);
BITMAP_FREE (visited);
}
} }
/* Given a pointer variable P, fill in its points-to set, or return /* Given a pointer variable P, fill in its points-to set, or return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment