[Bug middle-end/48760] [4.6 / 4.7 Regression (?)] std::complex constructor buggy in the face of NaN's
paolo.carlini at oracle dot com
gcc-bugzilla@gcc.gnu.org
Mon Apr 25 12:42:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48760
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-04-25 12:41:59 UTC ---
PR24581 can be related, its additional, "unexpected", nans.
A C snippet showing the issue would be:
int main()
{
float r = 0;
float i = __builtin_nanf ("");
__complex__ float c = r + i * 1.0fi;
/*
__complex__ float c;
__real__ c = r;
__imag__ c = i;
*/
__builtin_printf("%f\n", __real__ c);
__builtin_printf("%f\n", __imag__ c);
}
Indeed, I could tweak the library to construct the complex by pieces, avoiding
the multiplication by the imaginary constant in the constructor, but the
problem would definitely reappear at any following multiplication...
More information about the Gcc-bugs
mailing list