gcc/gcc ChangeLog fold-const.c testsuite/Chang ...

sayle@gcc.gnu.org sayle@gcc.gnu.org
Sat Jun 19 00:17:00 GMT 2004


CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2004-06-19 00:17:34

Modified files:
	gcc            : ChangeLog fold-const.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: unordered-2.c unordered-3.c 

Log message:
	* 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.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4036&r2=2.4037
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.401&r2=1.402
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3873&r2=1.3874
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/unordered-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/unordered-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



More information about the Gcc-cvs mailing list