aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-07-20 15:13:58 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-07-20 15:13:58 +0000
commitf8ecf734ddb7fb486855929b16f84af55b346711 (patch)
treedf2efba10f223dffa23f77c1e089f1043a930599 /gcc/tree-ssa-phiopt.c
parent73451ae7855681759cde520c001171d9d1bede96 (diff)
downloadgcc-f8ecf734ddb7fb486855929b16f84af55b346711.zip
gcc-f8ecf734ddb7fb486855929b16f84af55b346711.tar.gz
gcc-f8ecf734ddb7fb486855929b16f84af55b346711.tar.bz2
tree-ssa-forwprop.c (remove_prop_source_from_use): Robustify against already removed statements.
2011-07-20 Richard Guenther <rguenther@suse.de> * tree-ssa-forwprop.c (remove_prop_source_from_use): Robustify against already removed statements. (forward_propagate_into_comparison): Remove dead defining stmts. (forward_propagate_into_gimple_cond): Likewise. (forward_propagate_into_cond): Simplify. (ssa_forward_propagate_and_combine): Handle changed cfg from forward_propagate_into_comparison. * tree-ssa-phiopt.c (conditional_replacement): Use proper locations for newly built statements. From-SVN: r176517
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r--gcc/tree-ssa-phiopt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 79e8e01..ed8f979 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -544,8 +544,9 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
/* To handle special cases like floating point comparison, it is easier and
less error-prone to build a tree and gimplify it on the fly though it is
less efficient. */
- cond = fold_build2 (gimple_cond_code (stmt), boolean_type_node,
- gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+ cond = fold_build2_loc (gimple_location (stmt),
+ gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
/* We need to know which is the true edge and which is the false
edge so that we know when to invert the condition below. */
@@ -554,7 +555,8 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
|| (e0 == false_edge && integer_onep (arg0))
|| (e1 == true_edge && integer_zerop (arg1))
|| (e1 == false_edge && integer_onep (arg1)))
- cond = fold_build1 (TRUTH_NOT_EXPR, TREE_TYPE (cond), cond);
+ cond = fold_build1_loc (gimple_location (stmt),
+ TRUTH_NOT_EXPR, TREE_TYPE (cond), cond);
/* Insert our new statements at the end of conditional block before the
COND_STMT. */