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...

Reply via email to