From b0273ac64cf7b114d5187637b688a2a57228ebde Mon Sep 17 00:00:00 2001 From: kazu Date: Tue, 26 Apr 2005 15:16:51 +0000 Subject: [PATCH] PR tree-optimization/21047 * fold-const.c (fold_binary): Abort on ASSERT_EXPR. (fold): Don't handle ASSERT_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98770 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/fold-const.c | 19 ++++--------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 74a7b894c48..2d441c43cab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,10 @@ * basic-block.h (ei_cond): New. (FOR_EACH_EDGE): Call ei_cond. + PR tree-optimization/21047 + * fold-const.c (fold_binary): Abort on ASSERT_EXPR. + (fold): Don't handle ASSERT_EXPR. + 2005-04-25 Roger Sayle * sched-deps.c (sched_analyze_1): On STACK_REGS targets, x87, treat diff --git a/gcc/fold-const.c b/gcc/fold-const.c index a75d1a25063..416d89e1cdf 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -9864,6 +9864,10 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) return build_complex (type, arg0, arg1); return NULL_TREE; + case ASSERT_EXPR: + /* An ASSERT_EXPR should never be passed to fold_binary. */ + gcc_unreachable (); + default: return NULL_TREE; } /* switch (code) */ @@ -10147,21 +10151,6 @@ fold (tree expr) case CONST_DECL: return fold (DECL_INITIAL (t)); - case ASSERT_EXPR: - { - /* Given ASSERT_EXPR , return Y if COND can be folded - to boolean_true_node. If COND folds to boolean_false_node, - return ASSERT_EXPR . Otherwise, return the original - expression. */ - tree c = fold (ASSERT_EXPR_COND (t)); - if (c == boolean_true_node) - return ASSERT_EXPR_VAR (t); - else if (c == boolean_false_node) - return build (ASSERT_EXPR, TREE_TYPE (t), ASSERT_EXPR_VAR (t), c); - else - return t; - } - default: return t; } /* switch (code) */ -- 2.11.0