This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -O generates NaN
- To: libstdc++ at gcc dot gnu dot org
- Subject: Re: -O generates NaN
- From: Haruhiko Okumura <okumura at matsusaka-u dot ac dot jp>
- Date: Sat, 03 Mar 2001 14:26:57 +0900
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <20010303100758A.okumura@matsusaka-u.ac.jp>
The problem looks like a gcc bug. The attached shorter program,
nan3.cc, also generates NaN's only when compiled with -O.
> Hi,
>
> Could someone tell why this code generates lots of NaN's when compiled
> with any optimization flag (-O, -O2 etc) on?
>
> $ g++ nan.cc ... OK
> $ g++ -O nan.cc ... nan
>
> $ g++ -v
> Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
> Configured with: ../gcc/configure --enable-shared --enable-languages=c++,f77
> gcc version 3.1 20010227 (experimental)
--
Haruhiko Okumura <okumura@matsusaka-u.ac.jp>
Matsusaka University, 1846 Kubo-cho, Matsusaka, 515-8511 Japan
Phone: +81-598-29-1122 Fax: +81-598-29-1014
http://www.matsusaka-u.ac.jp/~okumura/