summaryrefslogtreecommitdiff
path: root/gcc/tree-complex.c
diff options
context:
space:
mode:
authorespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-08 22:16:59 +0000
committerespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-08 22:16:59 +0000
commit7076cb5d4e3cd60cb81233018268f3e27371cd28 (patch)
tree465e7779ecfa60e33ba35e94156083288329e034 /gcc/tree-complex.c
parent25a52e22f72155e303a1718f65ed1a133902810c (diff)
downloadgcc-7076cb5d4e3cd60cb81233018268f3e27371cd28.tar.gz
* tree-complex.c (expand_complex_div_wide): Don't create CONDs that
trap. * tree-gimple.c (is_gimple_condexpr): Check that the expression doesn't trap and that both operands are gimple values. (canonicalize_cond_expr_cond): Use is_gimple_condexpr. * gcc/tree-eh.c (tree_could_trap_p): Correctly detect if a comparison is a fp operation. * gcc/testsuite/gcc.dg/vect/vect-111.c: Rename to no-trapping-math-vect-111.c * gcc/testsuite/gcc.dg/vect/vect-ifcvt-11.c: Rename to no-trapping-math-vect-ifcvt-11.c * gcc/testsuite/gcc.dg/vect/vect-ifcvt-12.c: Rename to no-trapping-math-vect-ifcvt-12.c * gcc/testsuite/gcc.dg/vect/vect-ifcvt-13.c: Rename to no-trapping-math-vect-ifcvt-13.c * gcc/testsuite/gcc.dg/vect/vect-ifcvt-14.c: Rename to no-trapping-math-vect-ifcvt-14.c * gcc/testsuite/gcc.dg/vect/vect-ifcvt-15.c: Rename to no-trapping-math-vect-ifcvt-15.c git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135093 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-complex.c')
-rw-r--r--gcc/tree-complex.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 4703e78d22d..8d680dfa6bf 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -1047,22 +1047,30 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
tree ar, tree ai, tree br, tree bi,
enum tree_code code)
{
- tree rr, ri, ratio, div, t1, t2, tr, ti, cond;
+ tree rr, ri, ratio, div, t1, t2, tr, ti, compare;
basic_block bb_cond, bb_true, bb_false, bb_join;
/* Examine |br| < |bi|, and branch. */
t1 = gimplify_build1 (bsi, ABS_EXPR, inner_type, br);
t2 = gimplify_build1 (bsi, ABS_EXPR, inner_type, bi);
- cond = fold_build2 (LT_EXPR, boolean_type_node, t1, t2);
- STRIP_NOPS (cond);
+ compare = fold_build2 (LT_EXPR, boolean_type_node, t1, t2);
+ STRIP_NOPS (compare);
bb_cond = bb_true = bb_false = bb_join = NULL;
rr = ri = tr = ti = NULL;
- if (!TREE_CONSTANT (cond))
+ if (!TREE_CONSTANT (compare))
{
edge e;
+ tree cond, tmp;
- cond = build3 (COND_EXPR, void_type_node, cond, NULL_TREE, NULL_TREE);
+ tmp = create_tmp_var (boolean_type_node, NULL);
+ cond = build_gimple_modify_stmt (tmp, compare);
+ if (gimple_in_ssa_p (cfun))
+ tmp = make_ssa_name (tmp, cond);
+ GIMPLE_STMT_OPERAND (cond, 0) = tmp;
+ bsi_insert_before (bsi, cond, BSI_SAME_STMT);
+
+ cond = build3 (COND_EXPR, void_type_node, tmp, NULL_TREE, NULL_TREE);
bsi_insert_before (bsi, cond, BSI_SAME_STMT);
/* Split the original block, and create the TRUE and FALSE blocks. */
@@ -1098,7 +1106,7 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
ti = (ai * ratio) - ar;
tr = tr / div;
ti = ti / div; */
- if (bb_true || integer_nonzerop (cond))
+ if (bb_true || integer_nonzerop (compare))
{
if (bb_true)
{
@@ -1137,7 +1145,7 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
ti = b - (a * ratio);
tr = tr / div;
ti = ti / div; */
- if (bb_false || integer_zerop (cond))
+ if (bb_false || integer_zerop (compare))
{
if (bb_false)
{