From 8e3df5dce2b3501e9f556fe8c7b956b0592022dd Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 27 Jan 1997 09:05:06 -0500 Subject: [PATCH] (fold): Don't make COND_EXPR when both expr and one part are comparisons. From-SVN: r13553 --- gcc/fold-const.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/fold-const.c b/gcc/fold-const.c index dedbeed49d8..e76d6b93caf 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3756,7 +3756,8 @@ fold (expr) fold (build (code, type, arg0, TREE_OPERAND (arg1, 1)))); else if (TREE_CODE (arg1) == COND_EXPR - || TREE_CODE_CLASS (TREE_CODE (arg1)) == '<') + || (TREE_CODE_CLASS (TREE_CODE (arg1)) == '<' + && TREE_CODE_CLASS (code) != '<')) { tree test, true_value, false_value; @@ -3812,7 +3813,8 @@ fold (expr) return build (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0), fold (build (code, type, TREE_OPERAND (arg0, 1), arg1))); else if (TREE_CODE (arg0) == COND_EXPR - || TREE_CODE_CLASS (TREE_CODE (arg0)) == '<') + || (TREE_CODE_CLASS (TREE_CODE (arg0)) == '<' + && TREE_CODE_CLASS (code) != '<')) { tree test, true_value, false_value; -- 2.30.2