diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-09-05 08:39:42 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-09-05 08:39:42 +0000 |
commit | 2228ea8f1abac381d6dd4ace62f44f734660491e (patch) | |
tree | 1d8da7d4ffe531ba692eaaf37c1c19d211862241 /gcc | |
parent | fd2730c0a6adf8791147dd9718d653ab8ec7c044 (diff) | |
download | gcc-2228ea8f1abac381d6dd4ace62f44f734660491e.tar.gz |
2006-09-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/28900
* tree-if-conv.c (find_phi_replacement_condition): Gimplify
compound conditional before creating COND_EXPR condition.
* gcc.dg/torture/pr28900.c: New testcase
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116697 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr28900.c | 15 | ||||
-rw-r--r-- | gcc/tree-if-conv.c | 5 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 30a49bb379f..ba5a9e0d2d0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2006-09-05 Richard Guenther <rguenther@suse.de> + PR tree-optimization/28900 + * tree-if-conv.c (find_phi_replacement_condition): Gimplify + compound conditional before creating COND_EXPR condition. + +2006-09-05 Richard Guenther <rguenther@suse.de> + PR tree-optimization/28905 * tree-vrp.c (fix_equivalence_set): Manually implement !value_ranges_intersect_p to also handle symbolic ranges. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a1946dddf41..ac55cac729d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2006-09-05 Richard Guenther <rguenther@suse.de> + PR tree-optimization/28900 + * gcc.dg/torture/pr28900.c: New testcase + +2006-09-05 Richard Guenther <rguenther@suse.de> + PR tree-optimization/28905 * gcc.c-torture/compile/pr28905.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/torture/pr28900.c b/gcc/testsuite/gcc.dg/torture/pr28900.c new file mode 100644 index 00000000000..75555f46ec0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr28900.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-ftree-vectorize" } */ + +int synths_ ( float * rc) +{ + float r1, r2; + int i; + for (i = 0; i < 128; ++i) + { + r2 = rc[i]; + r1 = ((r2) <= (.99f) ? (r2) : (.99f)); + rc[i] = ((r1) >= (-.99f) ? (r1) : (-.99f)); + } +} + diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index ecd1368cd27..6e16a40a9c3 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -666,7 +666,7 @@ find_phi_replacement_condition (struct loop *loop, { basic_block first_bb = NULL; basic_block second_bb = NULL; - tree tmp_cond; + tree tmp_cond, new_stmts; gcc_assert (EDGE_COUNT (bb->preds) == 2); first_bb = (EDGE_PRED (bb, 0))->src; @@ -732,6 +732,9 @@ find_phi_replacement_condition (struct loop *loop, value as condition. Various targets use different means to communicate condition in vector compare operation. Using gimple value allows compiler to emit vector compare and select RTL without exposing compare's result. */ + *cond = force_gimple_operand (*cond, &new_stmts, false, NULL_TREE); + if (new_stmts) + bsi_insert_before (bsi, new_stmts, BSI_SAME_STMT); if (!is_gimple_reg (*cond) && !is_gimple_condexpr (*cond)) { tree new_stmt; |