optimization/8635: incorrect optimization of 0.0 * Infinity

petdr@cs.mu.OZ.AU petdr@cs.mu.OZ.AU
Tue Nov 19 05:46:00 GMT 2002


>Number:         8635
>Category:       optimization
>Synopsis:       incorrect optimization of 0.0 * Infinity
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 19 05:06:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Peter Ross
>Release:        3.0.4 (Debian testing/unstable)
>Organization:
>Environment:
System: Linux ceres 2.4.16 #1 Thu Dec 20 12:41:36 EST 2001 i686 Intel(R) Pentium(R) 4 CPU 1.60GHz GenuineIntel GNU/Linux
Architecture: i686

	
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
    0.0 * (DBL_MAX + DBL_MAX) is incorrectly optimized so that the
    result is 0.0 instead of Not a Number (NaN) at optimization level
    -O1 or greater.
>How-To-Repeat:
    gcc -O1 float.i
    ./a.out

0 is output and NaN should be.

begin 644 float.i.gz
M'XL("``OVCT``V9L;V%T+FD`[1QK;]S&\;,._1%;&RUT\D6^AYX]I$6:**Y0
MV3)L)T#A&@3%6TJ,^+CP<9):^+]W]L5]DSPI`5+$%^1,[CQV=F9V=G9V3\_1
M##V+TR*L]Z-G(S0:C9Z3EI=-5;Y,\BAM5OAE5:^28O_F&0`6%,7\M&TV;8S#
MNBEQU44^\K0._W1R11H&(D(>S#O$7.@,D>/)\7F.YM.3'JZ#AH$<?=H]>RSU
M4+V,5C@>I&ZDO9E]/D='AUW<%R:E2V6.[JTF"]FE<(\1D.O9IS)J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