re PR middle-end/20539 (ICE in simplify_subreg, at simplify-rtx.c:3674)
authorRoger Sayle <roger@eyesopen.com>
Mon, 21 Mar 2005 03:30:08 +0000 (03:30 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 21 Mar 2005 03:30:08 +0000 (03:30 +0000)
commit90ec750dbf67872ce3076fceaf3b8df570c75c45
tree64a437ac2c7bf9dae4641ceb3ef591d6abc0a7e6
parent37dc0d8dc7248b0495b56a26ca436f3980271587
re PR middle-end/20539 (ICE in simplify_subreg, at simplify-rtx.c:3674)

PR middle-end/20539
* fold-const.c (fold_binary): Fix type mismatch between
TRUTH_{AND,OR,XOR}_EXPR nodes an their operands' types.
(fold_binary) <TRUTH_XOR_EXPR>: Avoid calling invert_truthvalue
for non-truth-valued expressions.

* c-common.c (c_common_truthvalue_conversion): Handle ERROR_MARK
and FUNCTION_DECL in the main switch.
<TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR,
TRUTH_XOR_EXPR>: When changing the result type of these tree nodes,
we also need to convert their operands to match.
<TRUTH_NOT_EXPR>: Likewise.

* gcc.c-torture/compile/pr13066-1.c: New test case.
* gcc.c-torture/compile/pr20539-1.c: Likewise.
* g++.dg/opt/pr13066-1.C: Likewise.

From-SVN: r96777
gcc/ChangeLog
gcc/c-common.c
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr13066-1.C [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr13066-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr20539-1.c [new file with mode: 0644]