I've bootstrapped a gcc tree with the fix for PR 19486 and
flags_complex_divide_method=1 , and found that the code now
confuses the real and complex parts for divisions in certain
cases.

Here's an example:

$ cat complex-a.c
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <complex.h>

int main()
{
    complex float a,b,c;
    a = I;
    b = I;
    c = a/b;
    printf("%f + %f*I\n",crealf(c),cimagf(c));
    return 0;
}
$ gcc complex-a.c
$ ./a.out
0.000000 + 1.000000*I

-- 
           Summary: real and imaginary part interchanged when
                    flags_complex_divide_method=1
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Thomas dot Koenig at online dot de
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19609

Reply via email to