[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [about optimization]Is this a bug of gcc?
From: |
Lionel B |
Subject: |
Re: [about optimization]Is this a bug of gcc? |
Date: |
Fri, 15 Feb 2008 17:17:54 +0000 (UTC) |
User-agent: |
Pan/0.132 (Waxed in Black) |
On Fri, 15 Feb 2008 20:05:06 +0800, mojianhao wrote:
> Hi experts, I have a small test case, it got different result when
> compile with -O0 option and -O2 option. Is this a bug of gcc
> ?
[...]
Wow, that took some reformatting! What newsreader are you using?
Anyhow, no it's almost certainly not a bug. Read up on why floating point
comparisons can give unexpected results. Here's a good place to start:
http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.17
If you can get your head round that and want to dig a little deeper, try:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
Regards,
--
Lionel B