This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Minor fix to fold-const.c
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Feb 2004 09:56:51 -0700
- Subject: Minor fix to fold-const.c
- Reply-to: law at redhat dot com
Bug 14196 for the tree-ssa branch points out a generic problem with our
folders. Specifically we can call invert_tree_comparison with an
unordered tree comparison code, which causes invert_tree_comparison to
abort. Not good.
Bootstrapped and regression tested i686-pc-linux-gnu for both the mainline
sources as well as the tree-ssa branch.
* fold-const.c (invert_truthvalue): Do not call invert_tree_comparison
for unordered comparison codes.
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.213.2.71
diff -c -3 -p -r1.213.2.71 fold-const.c
*** fold-const.c 16 Feb 2004 11:59:35 -0000 1.213.2.71
--- fold-const.c 18 Feb 2004 21:46:54 -0000
*************** invert_truthvalue (tree arg)
*** 2623,2628 ****
--- 2623,2636 ----
&& code != NE_EXPR
&& code != EQ_EXPR)
return build1 (TRUTH_NOT_EXPR, type, arg);
+ else if (code == UNORDERED_EXPR
+ || code == ORDERED_EXPR
+ || code == UNEQ_EXPR
+ || code == UNLT_EXPR
+ || code == UNLE_EXPR
+ || code == UNGT_EXPR
+ || code == UNGE_EXPR)
+ return build1 (TRUTH_NOT_EXPR, type, arg);
else
return build (invert_tree_comparison (code), type,
TREE_OPERAND (arg, 0), TREE_OPERAND (arg, 1));