aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ifcombine.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-07-22 11:31:50 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-07-22 11:31:50 +0000
commit8bb8e838416dce451fae352df5198f99e5f84da5 (patch)
tree2b717adaafe8433027ff31c83f676589f58cf74b /gcc/tree-ssa-ifcombine.c
parentb1db706aba296e3bbb369102a540169315888dce (diff)
downloadgcc-8bb8e838416dce451fae352df5198f99e5f84da5.zip
gcc-8bb8e838416dce451fae352df5198f99e5f84da5.tar.gz
gcc-8bb8e838416dce451fae352df5198f99e5f84da5.tar.bz2
re PR tree-optimization/66952 (wrong code at -O2 and -O3 on x86_64-linux-gnu)
2015-07-22 Richard Biener <rguenther@suse.de> PR tree-optimization/66952 * tree-ssa-ifcombine.c (pass_tree_ifcombine::execute): For blocks we end up executing unconditionally reset all SSA info such as range and alignment. * tree-ssanames.h (reset_flow_sensitive_info): Declare. * tree-ssanames.c (reset_flow_sensitive_info): New function. * gcc.dg/torture/pr66952.c: New testcase. From-SVN: r226062
Diffstat (limited to 'gcc/tree-ssa-ifcombine.c')
-rw-r--r--gcc/tree-ssa-ifcombine.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index e199689..ef3d16d 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -765,7 +765,22 @@ pass_tree_ifcombine::execute (function *fun)
if (stmt
&& gimple_code (stmt) == GIMPLE_COND)
- cfg_changed |= tree_ssa_ifcombine_bb (bb);
+ if (tree_ssa_ifcombine_bb (bb))
+ {
+ /* Clear range info from all stmts in BB which is now executed
+ conditional on a always true/false condition. */
+ for (gimple_stmt_iterator gsi = gsi_start_bb (bb);
+ !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ ssa_op_iter i;
+ tree op;
+ FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_DEF)
+ reset_flow_sensitive_info (op);
+ }
+
+ cfg_changed |= true;
+ }
}
free (bbs);