summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ifcombine.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-04 09:37:04 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-04 09:37:04 +0000
commita7392604d3a2cd80ea3b58a91019dad327a2c569 (patch)
treee796856d793e5691b916e4fbbedc157a8e3dce8b /gcc/tree-ssa-ifcombine.c
parent1fd77946b49f4ff86be3e862908a8ea10b413bcd (diff)
downloadgcc-a7392604d3a2cd80ea3b58a91019dad327a2c569.tar.gz
2007-10-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/33627 * tree-gimple.h (canonicalize_cond_expr_cond): Declare. * tree-gimple.c (canonicalize_cond_expr_cond): New function, split out from ... * tree-ssa-forwprop.c (combine_cond_expr_cond): ... here. * tree-ssa-ifcombine.c (ifcombine_iforif): Use it. * g++.dg/torture/pr33627.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129004 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ifcombine.c')
-rw-r--r--gcc/tree-ssa-ifcombine.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index f52585ca20e..eef6f22d2a2 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -483,6 +483,9 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
/* Do it. */
t = fold_build2 (code, boolean_type_node,
TREE_OPERAND (ccond2, 0), TREE_OPERAND (ccond2, 1));
+ t = canonicalize_cond_expr_cond (t);
+ if (!t)
+ return false;
COND_EXPR_COND (inner_cond) = t;
update_stmt (inner_cond);