[Bug target/31161] __builtin_cexpi is broken on Darwin

dominiq at lps dot ens dot fr gcc-bugzilla@gcc.gnu.org
Thu Mar 15 08:35:00 GMT 2007



------- Comment #5 from dominiq at lps dot ens dot fr  2007-03-15 08:34 -------
> Can you check if the attached patch gives a more reasonable error?

I now get:

failure_v2.c: In function 'main':
failure_v2.c:15: sorry, unimplemented: no way to expand a call to 'cexpi'

but would not it be more natural to get the behavior I see with gcc version
4.2.0 20070221?

/usr/bin/ld: Undefined symbols:
___builtin_cexpi
collect2: ld returned 1 exit status

Now from this, am I right to conclude that TARGET_C99_FUNCTIONS is not set in
my build?
If yes, how does it come that g++ and gfortran use __builtin_cexpi when a code
use
cos(phi) and sin(phi) with -O1:

;; Function int main() (main)

Analyzing Edge Insertions.
int main() ()
{
  complex double sincostmp.18;

<bb 2>:
  sincostmp.18 = __builtin_cexpi (IMAGPART_EXPR <__builtin_clog (__complex__
(-1.0e+0, 0.0))> * 5.0e-1);
  printf (&"%g %g\n"[0], REALPART_EXPR <sincostmp.18>, IMAGPART_EXPR
<sincostmp.18>);
  return 0;

}

where __builtin_cexpi seems to be used and returning a wrong result, thus
leading to PR30980?


-- 


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



More information about the Gcc-bugs mailing list