re PR c/54103 (ICE at gimplify.c:7790 on current trunk)
authorJoseph Myers <joseph@codesourcery.com>
Fri, 14 Sep 2012 16:59:10 +0000 (17:59 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Fri, 14 Sep 2012 16:59:10 +0000 (17:59 +0100)
commita27d595da25b497f14d8f3714b63819f712cde11
tree95a34b6ced24ac7d8b25b3d0768dbbb429f9ac2e
parent937f6ef1451c19076caa9add827a3921f6aead06
re PR c/54103 (ICE at gimplify.c:7790 on current trunk)

c:
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.

From-SVN: r191304
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr54103-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr54103-2.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr54103-3.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr54103-4.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr54103-5.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr54103-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c90-const-expr-8.c