http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54103
--- Comment #3 from Joseph S. Myers 2012-09-15
00:28:08 UTC ---
Author: jsm28
Date: Sat Sep 15 00:28:05 2012
New Revision: 191336
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191336
Log:
PR c/54103
* c-typeck.c (build_unary_op): Pass original argument of
TRUTH_NOT_EXPR to c_objc_common_truthvalue_conversion, then remove
any C_MAYBE_CONST_EXPR, if it has integer operands.
(build_binary_op): Pass original arguments of TRUTH_ANDIF_EXPR,
TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR
to c_objc_common_truthvalue_conversion, then remove any
C_MAYBE_CONST_EXPR, if they have integer operands. Use
c_objc_common_truthvalue_conversion not
c_common_truthvalue_conversion.
(c_objc_common_truthvalue_conversion): Build NE_EXPR directly and
call note_integer_operands for arguments with integer operands
that are not integer constants.
testsuite:
* gcc.c-torture/compile/pr54103-1.c,
gcc.c-torture/compile/pr54103-2.c,
gcc.c-torture/compile/pr54103-3.c,
gcc.c-torture/compile/pr54103-4.c,
gcc.c-torture/compile/pr54103-5.c,
gcc.c-torture/compile/pr54103-6.c: New tests.
* gcc.dg/c90-const-expr-8.c: Update expected column number.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-1.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-2.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-3.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-4.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-5.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.c-torture/compile/pr54103-6.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/c-typeck.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/c90-const-expr-8.c