diff options
author | Richard Guenther <rguenther@suse.de> | 2009-03-04 12:36:56 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-03-04 12:36:56 +0000 |
commit | 6a66f28ed5619a2ecacdede659833cc71c9dba11 (patch) | |
tree | 92c85ca3e2336e61a8a95e170ee3d512f57cdf2a /gcc/tree-ssa-structalias.c | |
parent | c0de290730e2c795d31f0c17d9ceede31d6b6161 (diff) | |
download | gcc-6a66f28ed5619a2ecacdede659833cc71c9dba11.zip gcc-6a66f28ed5619a2ecacdede659833cc71c9dba11.tar.gz gcc-6a66f28ed5619a2ecacdede659833cc71c9dba11.tar.bz2 |
re PR tree-optimization/39358 (Wrong aliasing warning with lists)
2009-03-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39358
* tree-ssa-structalias.c (do_sd_constraint): Fix check for
escaped_id and callused_id.
(solve_graph): Likewise.
* g++.dg/warn/Wstrict-aliasing-bogus-escape-2.C: New testcase.
* g++.dg/warn/Wstrict-aliasing-bogus-escape-3.C: Likewise.
From-SVN: r144602
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 07fd9ed..732bc6f 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -1524,8 +1524,8 @@ do_sd_constraint (constraint_graph_t graph, constraint_t c, of a variable can also reach all other fields of the variable we simply have to expand the solution to contain all sub-fields if one sub-field is contained. */ - if (c->rhs.var == escaped_id - || c->rhs.var == callused_id) + if (c->rhs.var == find (escaped_id) + || c->rhs.var == find (callused_id)) { bitmap vars = NULL; /* In a first pass record all variables we need to add all @@ -1594,9 +1594,10 @@ do_sd_constraint (constraint_graph_t graph, constraint_t c, /* Merging the solution from ESCAPED needlessly increases the set. Use ESCAPED as representative instead. Same for CALLUSED. */ - else if (get_varinfo (t)->id == escaped_id - || get_varinfo (t)->id == callused_id) - flag |= bitmap_set_bit (sol, get_varinfo (t)->id); + else if (get_varinfo (t)->id == find (escaped_id)) + flag |= bitmap_set_bit (sol, escaped_id); + else if (get_varinfo (t)->id == find (callused_id)) + flag |= bitmap_set_bit (sol, callused_id); else if (add_graph_edge (graph, lhs, t)) flag |= bitmap_ior_into (sol, get_varinfo (t)->solution); } @@ -2516,8 +2517,8 @@ solve_graph (constraint_graph_t graph) if (!solution_empty /* Do not propagate the ESCAPED/CALLUSED solutions. */ - && i != escaped_id - && i != callused_id) + && i != find (escaped_id) + && i != find (callused_id)) { bitmap_iterator bi; |