------- Comment #25 from fxcoudert at gcc dot gnu dot org  2008-02-22 10:21 
-------
Created an attachment (id=15206)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15206&action=view)
Complete patch

That patch builds fine on powerpc-apple-darwin9.2.0. The C compiler generated
seems OK:

$ cat s.c
#include <stdio.h>
int main (void)
{
  long double x;
  double y;

  x = -0.24; y = x;
  printf ("%g %g %g\n", (float) __builtin_asinl(x), (float) __builtin_asin(y),
          (float) (__builtin_asinl(x) - __builtin_asin(y)));
}

$ ./bin/gcc s.c -mlong-double-64 && ./a.out
-0.242366 -0.242366 0
$ nm ./a.out | grep asinl
         U _asinl

$ ./bin/gcc s.c -mlong-double-128 && ./a.out
-0.242366 -0.242366 -8.82009e-18
$ nm ./a.out | grep asinl
         U _asinl$LDBL128

but the Fortran front-end apparently doesn't benefit from it:

$ cat s.f90
  real(16) :: x
  real(8) :: y

  x = -0.24
  y = x
  print *, asin(x), asin(y), asin(x) - asin(y)
  print *, real(asin(x)), real(asin(y)), real(asin(x) - asin(y))
end
$ ./bin/gfortran s.f90 && ./a.out
 -0.24236584551303838594503263503820989       -0.24236584551303839      
0.50000000000000000000000000000000000      
 -0.24236585     -0.24236585      0.50000000    
$ nm a.out | grep asinl
         U _asinl


Another issue is about -mmacosx-version-min. I'm not sure what should happen,
but I have the following:

$ ./bin/gcc s.c -mmacosx-version-min=10.2.8 && ./a.out
-0.242366 -0.242366 -8.82009e-18
$ nm a.out | grep asinl
         U _asinl$LDBL128

If I understand correctly, this should give _asinl and not the $LDBL128
variant.

Any help appreciated.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15203|0                           |1
        is obsolete|                            |


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

Reply via email to