summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ifcombine.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-10 14:53:27 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-10 14:53:27 +0000
commitb611dd5f0183cb072a7cfb8cddfdfdfa6234fc29 (patch)
treef61162308417f730044161c62446557cddff40bf /gcc/tree-ssa-ifcombine.c
parent0276cac6391875af26d797e9916683bd36d0ca80 (diff)
downloadgcc-b611dd5f0183cb072a7cfb8cddfdfdfa6234fc29.tar.gz
2009-10-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/41654 * tree-ssa-ifcombine.c (ifcombine_ifandif): Properly canonicalize a cond expr before calling gimple_cond_set_condition_from_tree. (ifcombine_iforif): Likewise. * gfortran.fortran-torture/compile/pr41654.f90: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152620 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ifcombine.c')
-rw-r--r--gcc/tree-ssa-ifcombine.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index 1d2d85b7a8f..335b4fd95fc 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -340,6 +340,9 @@ ifcombine_ifandif (basic_block inner_cond_bb, basic_block outer_cond_bb)
t2 = force_gimple_operand_gsi (&gsi, t2, true, NULL_TREE,
true, GSI_SAME_STMT);
t = fold_build2 (EQ_EXPR, boolean_type_node, t2, t);
+ t = canonicalize_cond_expr_cond (t);
+ if (!t)
+ return false;
gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);
@@ -488,6 +491,9 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
true, GSI_SAME_STMT);
t = fold_build2 (NE_EXPR, boolean_type_node, t,
build_int_cst (TREE_TYPE (t), 0));
+ t = canonicalize_cond_expr_cond (t);
+ if (!t)
+ return false;
gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);