Recently (~10 days ago), 26_numerics/complex/13450.cc started failing for
*many* targets, among which powerpc-darwin. On the latter I'm seeing a
miscompilation at -O1 and above of this reduced C++ snippet:

#include <math.h>
#include <stdio.h>

int main()
{
  __complex__ double x;

  __real__ x = -1.0;
  __imag__ x = 0.0;

  __complex__ double t = __builtin_clog(x);

  double tmp = 0.5 * (__imag__ t);

  printf("%g %g\n", cos(tmp), sin(tmp));
}

/////////////////

Note how the output changes at -O1 and above. Also note that the very same
snippet, as C is fine, thus I'm categorizing as C++, not as middle-end or
something else.


-- 
           Summary: [4.3 Regression] Recent complex miscompilation
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pcarlini at suse dot de
GCC target triplet: powerpc-apple-darwin8.8.0


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

Reply via email to