OSDN Git Service

PR tree-optimization/21047
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Apr 2005 15:16:51 +0000 (15:16 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Apr 2005 15:16:51 +0000 (15:16 +0000)
* 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
gcc/fold-const.c

index 74a7b89..2d441c4 100644 (file)
@@ -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  <roger@eyesopen.com>
 
        * sched-deps.c (sched_analyze_1): On STACK_REGS targets, x87, treat
index a75d1a2..416d89e 100644 (file)
@@ -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 <Y, COND>, return Y if COND can be folded
-          to boolean_true_node.  If COND folds to boolean_false_node,
-          return ASSERT_EXPR <Y, 0>.  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) */