http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47493
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-27 17:04:51 UTC --- > (.rodata+0x68): undefined reference to `_gfortran_specific__sqrt_r8' Can you run: nm libgfortran.a |grep _gfortran_specific__sqrt_ on my system that gives: 0000000000000000 T _gfortran_specific__sqrt_r4 0000000000000000 T _gfortran_specific__sqrt_r8 0000000000000000 T _gfortran_specific__sqrt_r10 0000000000000000 T _gfortran_specific__sqrt_r16 0000000000000000 T _gfortran_specific__sqrt_c4 0000000000000000 T _gfortran_specific__sqrt_c8 0000000000000000 T _gfortran_specific__sqrt_c10 0000000000000000 T _gfortran_specific__sqrt_c16 and I somehow expect that also HPPA has a double-precision sqrt ... * * * The other question is: Why is that wrapper called and not directly __builtin_sqrt? In C that also works: #include <stdio.h> #include <math.h> static void myproc(double(*f)(double), double x) { printf("%e: %e %e\n", x, f(x),sqrt(x)); } main() { myproc(__builtin_sqrt, 4.0); return 0; } Result: printf (&"%e: %e %e\n"[0], 4.0e+0, 2.0e+0, 2.0e+0); return 0; While the Fortran equivalent produces: myproc (_gfortran_specific__sqrt_r8, &C.1537); and D.1545_3 = f_2(D) (x_1(D)); D.1547_5 = __builtin_sqrt (D.1546_4); for program main intrinsic dsqrt call myproc(dsqrt, 4.0d0) contains subroutine myproc(f, x) procedure(dsqrt) f real(8), value :: x print *, x, f(x), dsqrt(x) end subroutine myproc end program main The big other question is: why is "myproc" is not inlined? (For -O3 (-fwhole-program, (-flto)).)