aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index f200d48..80a53a8 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -175,7 +175,7 @@ init_bb_predicate (basic_block bb)
{
bb->aux = XNEW (struct bb_predicate_s);
set_bb_predicate_gimplified_stmts (bb, NULL);
- set_bb_predicate (bb, NULL_TREE);
+ set_bb_predicate (bb, boolean_true_node);
}
/* Free the predicate of basic block BB. */
@@ -203,6 +203,16 @@ free_bb_predicate (basic_block bb)
bb->aux = NULL;
}
+/* Free the predicate of BB and reinitialize it with the true
+ predicate. */
+
+static inline void
+reset_bb_predicate (basic_block bb)
+{
+ free_bb_predicate (bb);
+ init_bb_predicate (bb);
+}
+
/* Create a new temp variable of type TYPE. Add GIMPLE_ASSIGN to assign EXP
to the new variable. */
@@ -605,8 +615,7 @@ predicate_bbs (loop_p loop)
to be processed: skip it. */
if (bb == loop->latch)
{
- set_bb_predicate (loop->latch, boolean_true_node);
- set_bb_predicate_gimplified_stmts (loop->latch, NULL);
+ reset_bb_predicate (loop->latch);
continue;
}
@@ -680,7 +689,7 @@ predicate_bbs (loop_p loop)
}
/* The loop header is always executed. */
- set_bb_predicate (loop->header, boolean_true_node);
+ reset_bb_predicate (loop->header);
gcc_assert (bb_predicate_gimplified_stmts (loop->header) == NULL
&& bb_predicate_gimplified_stmts (loop->latch) == NULL);