Re: optimization bug gcc 4.1.2

2008-08-28 Thread Andrew Pinski
On Thu, Aug 28, 2008 at 11:27 PM, Fomin Eduard S. <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > inline double abs(double x) > { >// remove sign bit >*reinterpret_cast(&x) &= 0x7FFFLL; ... > This simple code works correct in DEBUG. But i

optimization bug gcc 4.1.2

2008-08-28 Thread Fomin Eduard S.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 inline double abs(double x) { // remove sign bit *reinterpret_cast(&x) &= 0x7FFFLL; return x; } int main(int argc, char *argv[]) { std::cout << "abs = " << abs(-2.1) << std::endl; } This simple code works