diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-09 11:06:34 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-09 11:06:34 +0000 |
commit | 2d09531c0e1bfdff0ff7670be039eae39f54d61c (patch) | |
tree | 177e1eca8dc59d171ca5d3c5e070b02640e36abb /gcc/tree-ssa-structalias.c | |
parent | 57510da6e9a4e4531a9c885b964eb91b28d12b10 (diff) | |
download | gcc-2d09531c0e1bfdff0ff7670be039eae39f54d61c.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142590 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 46781b82129..3d64c1cbd33 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -4704,8 +4704,9 @@ static bool have_alias_info = false; /* Emit a note for the pointer initialization point DEF. */ 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) { use_operand_p argp; @@ -4715,7 +4716,10 @@ emit_pointer_definition (gimple def) { tree arg = USE_FROM_PTR (argp); 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 inform (0, "initialized from %qE", arg); } @@ -4729,7 +4733,6 @@ emit_pointer_definition (gimple def) static void emit_alias_warning (tree ptr) { - gimple def = SSA_NAME_DEF_STMT (ptr); gimple use; imm_use_iterator ui; unsigned warned = 0; @@ -4777,7 +4780,11 @@ emit_alias_warning (tree ptr) } } 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 |