[Bug optimization/9325] wrong conversion of constants: (int)(float)(int) (INT_MAX)

cvs-commit at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Oct 3 21:34:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9325



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-10-03 21:34 -------
Subject: Bug 9325

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2003-10-03 21:33:57

Modified files:
	gcc            : ChangeLog fold-const.c tree.c simplify-rtx.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.c-torture/execute: 20031003-1.c 

Log message:
	PR optimization/9325, PR java/6391
	* fold-const.c (fold_convert): For floating point to integer
	conversions, return the maximum/minimum representable integer
	value if the real constant overflows the destination type.
	* tree.c (real_value_from_int_cst): Allow the type to be NULL,
	meaning don't truncate the result to a floating point mode.
	Simplify the logic by calling real_from_integer directly.
	* simplify-rtx.c (simplify_unary_operation):  Implement the
	same semantics for folding floating point to integer conversions
	in RTL.
	
	* gcc.c-torture/execute/20031003-1.c: New test case.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1270&r2=2.1271
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.310&r2=1.311
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&r1=1.330&r2=1.331
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/simplify-rtx.c.diff?cvsroot=gcc&r1=1.160&r2=1.161
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3093&r2=1.3094
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/20031003-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



More information about the Gcc-bugs mailing list