aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2007-10-28 15:57:50 +0100
committerUros Bizjak <uros@gcc.gnu.org>2007-10-28 15:57:50 +0100
commit77bd31de7ef25e0e7cce86d26d882815f9536d6b (patch)
tree67b12a9a6f98f99e2f991cab8fa948036244dbdc /gcc/tree-if-conv.c
parentc8d6f9e7e5f7cc755dbcaa74021002d8c593543b (diff)
downloadgcc-77bd31de7ef25e0e7cce86d26d882815f9536d6b.zip
gcc-77bd31de7ef25e0e7cce86d26d882815f9536d6b.tar.gz
gcc-77bd31de7ef25e0e7cce86d26d882815f9536d6b.tar.bz2
re PR tree-optimization/33920 (Segfault in combine_blocks/tree-if-conv.c)
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. From-SVN: r129696
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 f97c23d..9d2fe26 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;