X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fc-typeck.c;h=806a20ade96a65726dc3e79e3f0cbf4acc4d79f6;hb=bdaed7d2d9578b85a8480067e9b6ea59fd39bab3;hp=07471c7fd899bae1e86ab5a02afd963a9aa43e99;hpb=65441f6f247bd989d1832b74041bdf4ce2c75f0f;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 07471c7fd89..806a20ade96 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -2312,11 +2312,27 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl) return nreverse (result); } -/* This is the entry point used by the parser - for binary operators in the input. - In addition to constructing the expression, - we check for operands that were written with other binary operators - in a way that is likely to confuse the user. */ +/* This is the entry point used by the parser to build unary operators + in the input. CODE, a tree_code, specifies the unary operator, and + ARG is the operand. For unary plus, the C parser currently uses + CONVERT_EXPR for code. */ + +struct c_expr +parser_build_unary_op (enum tree_code code, struct c_expr arg) +{ + struct c_expr result; + + result.original_code = ERROR_MARK; + result.value = build_unary_op (code, arg.value, 0); + overflow_warning (result.value); + return result; +} + +/* This is the entry point used by the parser to build binary operators + in the input. CODE, a tree_code, specifies the binary operator, and + ARG1 and ARG2 are the operands. In addition to constructing the + expression, we check for operands that were written with other binary + operators in a way that is likely to confuse the user. */ struct c_expr parser_build_binary_op (enum tree_code code, struct c_expr arg1, @@ -3089,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