OSDN Git Service

* fold-const.c (fold) <UNORDERED_EXPR, ORDERED_EXPR, UNLT_EXPR,
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 Jun 2004 00:17:33 +0000 (00:17 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 Jun 2004 00:17:33 +0000 (00:17 +0000)
commit2f64c4305f43bd0d2970af561b59bd3915c1f121
tree9819bd8cdb1d4003c3909100c418617db3fb2944
parent7b43578784f746ad1f5a7755e51e0ef7b65c9910
* fold-const.c (fold) <UNORDERED_EXPR, ORDERED_EXPR, UNLT_EXPR,
UNLE_EXPR, UNGT_EXPR, UNGE_EXPR, UNEQ_EXPR, LTGT_EXPR>: Add
constant folding for unordered comparison tree nodes.  If both
operands are real constants, call fold_relational_const.  If either
operand is a NaN, evaluate the other for side-effects and return a
constant.  Optimize (double)float1 CMP (double)float2 into the
equivalent float1 CMP float2.
(nondestructive_fold_binary_to_constant) <UNORDERED_EXPR,
ORDERED_EXPR, UNLT_EXPR, UNLE_EXPR, UNGT_EXPR, UNGE_EXPR, UNEQ_EXPR,
LTGT_EXPR>: Call fold_relational_const for constant operands.
(fold_relational_const): Add support for unordered comparison tree
nodes.  Don't constant fold "ordered" floating point comparisons
against NaN if when flag_trapping_math is set.

* gcc.dg/unordered-2.c: New test case.
* gcc.dg/unordered-3.c: New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83379 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/unordered-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/unordered-3.c [new file with mode: 0644]