From f279e1909216063f61edab39be4a61e6a236b669 Mon Sep 17 00:00:00 2001 From: loki Date: Tue, 10 May 2005 13:47:05 +0000 Subject: 2005-05-10 Gabor Loki PR c/17913 * c-typeck.c (build_conditional_expr): Remove reducing cond_expr. * fold-const.c (fold): Expand the condition of reducing cond_expr. (contains_label_1, contains_label_p): New functions for checking labels in a sub-tree. testsuite: 2005-05-10 Gabor Loki PR c/17913 * gcc.c-torture/compile/pr17913.c: Computed jump test for PR17913 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99514 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-typeck.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gcc/c-typeck.c') diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index d3b1c957020..806a20ade96 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3105,10 +3105,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) if (result_type != TREE_TYPE (op2)) op2 = convert_and_check (result_type, op2); - if (TREE_CODE (ifexp) == INTEGER_CST) - return non_lvalue (integer_zerop (ifexp) ? op2 : op1); - - return fold (build3 (COND_EXPR, result_type, ifexp, op1, op2)); + return fold_build3 (COND_EXPR, result_type, ifexp, op1, op2); } /* Return a compound expression that performs two expressions and -- cgit v1.2.3