From: Richard Guenther Date: Fri, 9 Sep 2005 10:19:52 +0000 (+0000) Subject: re PR c++/23624 (ICE: internal compiler error: in invert_truthvalue, at fold-const... X-Git-Tag: releases/gcc-3.4.5~200 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f310b612a15370064f706926e9089de41785f3f;p=thirdparty%2Fgcc.git re PR c++/23624 (ICE: internal compiler error: in invert_truthvalue, at fold-const.c:2697) 2005-09-09 Richard Guenther PR c++/23624 * fold-const.c (fold): Check truth_value_p before calling invert_truthvalue. From-SVN: r104091 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9511a3eef0c0..2b6912beb54c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-09-09 Richard Guenther + + PR c++/23624 + * fold-const.c (fold): Check truth_value_p before calling + invert_truthvalue. + 2005-09-08 Craig Rodrigues Backport from mainline diff --git a/gcc/fold-const.c b/gcc/fold-const.c index bcc7dcdebbb4..ba9031b705e9 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -8199,8 +8199,9 @@ fold (tree expr) /* If the second operand is simpler than the third, swap them since that produces better jump optimization results. */ - if (tree_swap_operands_p (TREE_OPERAND (t, 1), - TREE_OPERAND (t, 2), false)) + if (truth_value_p (TREE_CODE (arg0)) + && tree_swap_operands_p (TREE_OPERAND (t, 1), + TREE_OPERAND (t, 2), false)) { /* See if this can be inverted. If it can't, possibly because it was a floating-point inequality comparison, don't do