]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/23624 (ICE: internal compiler error: in invert_truthvalue, at fold-const...
authorRichard Guenther <rguenther@suse.de>
Fri, 9 Sep 2005 10:19:52 +0000 (10:19 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 9 Sep 2005 10:19:52 +0000 (10:19 +0000)
2005-09-09  Richard Guenther  <rguenther@suse.de>

PR c++/23624
* fold-const.c (fold): Check truth_value_p before calling
invert_truthvalue.

From-SVN: r104091

gcc/ChangeLog
gcc/fold-const.c

index 9511a3eef0c0e9949780dca50316ccd07a368b31..2b6912beb54ca4bd34c9434eda4d41e2dae005b4 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-09  Richard Guenther  <rguenther@suse.de>
+
+       PR c++/23624
+       * fold-const.c (fold): Check truth_value_p before calling
+       invert_truthvalue.
+
 2005-09-08  Craig Rodrigues  <rodrigc@gcc.gnu.org>
 
        Backport from mainline
index bcc7dcdebbb48bdca46cdfa2702969d6dd590b03..ba9031b705e94d552cd85ae3936d34b5087d3a88 100644 (file)
@@ -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