summaryrefslogtreecommitdiffstats
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-28 14:57:50 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-28 14:57:50 +0000
commit63a1777b8588e0da96c72a2096c4fda7e9cf7bca (patch)
tree67b12a9a6f98f99e2f991cab8fa948036244dbdc /gcc/tree-if-conv.c
parenteb22060034f26830d5303e8f7d08ac0310e948a4 (diff)
downloadppe42-gcc-63a1777b8588e0da96c72a2096c4fda7e9cf7bca.tar.gz
ppe42-gcc-63a1777b8588e0da96c72a2096c4fda7e9cf7bca.zip
PR tree-optimization/33920
* tree-if-conv.c (tree_if_conversion): Force predicate of single successor bb to true when predecessor bb has NULL predicate. (find_phi_replacement_condition): Assert that tmp_cond is non-null. testsuite/ChangeLog: PR tree-optimization/33920 * gcc.dg/tree-ssa/pr33290.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129696 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index f97c23db93b..9d2fe265791 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -189,8 +189,14 @@ tree_if_conversion (struct loop *loop, bool for_vectorizer)
if (single_succ_p (bb))
{
basic_block bb_n = single_succ (bb);
- if (cond != NULL_TREE)
- add_to_predicate_list (bb_n, cond);
+
+ /* Successor bb inherits predicate of its predecessor. If there
+ is no predicate in predecessor bb, then consider successor bb
+ as always executed. */
+ if (cond == NULL_TREE)
+ cond = boolean_true_node;
+
+ add_to_predicate_list (bb_n, cond);
}
}
@@ -724,6 +730,8 @@ find_phi_replacement_condition (struct loop *loop,
/* Select condition that is not TRUTH_NOT_EXPR. */
tmp_cond = (first_edge->src)->aux;
+ gcc_assert (tmp_cond);
+
if (TREE_CODE (tmp_cond) == TRUTH_NOT_EXPR)
{
edge tmp_edge;
OpenPOWER on IntegriCloud