aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-12-04 17:20:34 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-12-04 17:20:34 +0000
commit54b7b17d73286a19d9a8f218f6ecf4d75e680046 (patch)
treee4978fe5fce020d21312561a9423cd654c78b718 /gcc/tree-ssa-operands.c
parent91ee70c3474d8ffe588224402caff0cafa4cdcef (diff)
downloadgcc-54b7b17d73286a19d9a8f218f6ecf4d75e680046.zip
gcc-54b7b17d73286a19d9a8f218f6ecf4d75e680046.tar.gz
gcc-54b7b17d73286a19d9a8f218f6ecf4d75e680046.tar.bz2
re PR middle-end/34334 (ICE in vuses_compare, at tree-vn.c:118)
2007-12-04 Richard Guenther <rguenther@suse.de> PR middle-end/34334 PR middle-end/34222 * tree-ssa-operands.c (get_addr_dereference_operands): If we fall back to using the SMTs aliases, make sure to add virtual operands for the SMT itself. (create_ssa_artificial_load_stmt): Fix typo. Make sure to also clear the loaded and stored symbols bitmaps. * gcc.c-torture/compile/pr34334.c: New testcase. * g++.dg/torture/pr34222.C: New testcase. From-SVN: r130602
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 96ed4ca..fb61166 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1665,8 +1665,18 @@ get_addr_dereference_operands (tree stmt, tree *addr, int flags, tree full_ref,
to make sure to not prune virtual operands based on offset
and size. */
if (v_ann->symbol_mem_tag)
- add_virtual_operand (v_ann->symbol_mem_tag, s_ann, flags,
- full_ref, 0, -1, false);
+ {
+ add_virtual_operand (v_ann->symbol_mem_tag, s_ann, flags,
+ full_ref, 0, -1, false);
+ /* Make sure we add the SMT itself. */
+ if (!(flags & opf_no_vops))
+ {
+ if (flags & opf_def)
+ append_vdef (v_ann->symbol_mem_tag);
+ else
+ append_vuse (v_ann->symbol_mem_tag);
+ }
+ }
/* Aliasing information is missing; mark statement as
volatile so we won't optimize it out too actively. */
@@ -2657,7 +2667,7 @@ create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt)
if (TREE_CODE (op) != SSA_NAME)
var_ann (op)->in_vuse_list = false;
- for (i = 0; VEC_iterate (tree, build_vuses, i, op); i++)
+ for (i = 0; VEC_iterate (tree, build_vdefs, i, op); i++)
if (TREE_CODE (op) != SSA_NAME)
var_ann (op)->in_vdef_list = false;
@@ -2665,6 +2675,10 @@ create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt)
VEC_truncate (tree, build_vdefs, 0);
VEC_truncate (tree, build_vuses, 0);
+ /* Clear the loads and stores bitmaps. */
+ bitmap_clear (build_loads);
+ bitmap_clear (build_stores);
+
/* For each VDEF on the original statement, we want to create a
VUSE of the VDEF result operand on the new statement. */
FOR_EACH_SSA_TREE_OPERAND (op, old_stmt, iter, SSA_OP_VDEF)