diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-20 15:13:58 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-20 15:13:58 +0000 |
commit | 6f9714b3fe62c08b5d1bcf64483d5da074e0e22f (patch) | |
tree | df2efba10f223dffa23f77c1e089f1043a930599 /gcc/tree-ssa-phiopt.c | |
parent | 9685fb69b2615db052080a08496f3aa137ec1892 (diff) | |
download | gcc-6f9714b3fe62c08b5d1bcf64483d5da074e0e22f.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176517 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r-- | gcc/tree-ssa-phiopt.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 79e8e015fda..ed8f9795e78 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. */ |