This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -O generates NaN


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]