[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #1 from rguenth at gcc dot gnu dot org 2007-09-29 12:45 --- libgfortran in general assumes that a full C99 runtime is available. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #2 from dave at hiauly1 dot hia dot nrc dot ca 2007-09-29 16:15 --- Subject: Re: FAIL: gfortran.dg/gamma_1.f90 > libgfortran in general assumes that a full C99 runtime is available. lgamma and lgamma_r are available, so it should be possible to fudge a f version. This is done for some other functions. I suspect that this has something to do with mpfr as HP-UX 11 doesn't have lgammaf and I'm not seeing the fail there. I updated mpfr from 2.2.1 to 2.3.0 last night, and started a new build. Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #3 from dave at hiauly1 dot hia dot nrc dot ca 2007-09-29 16:47 --- Subject: Re: FAIL: gfortran.dg/gamma_1.f90 > Subject: Re: FAIL: gfortran.dg/gamma_1.f90 > > > libgfortran in general assumes that a full C99 runtime is available. It was the fortran frontend that generated the call to lgammaf. Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #4 from fxcoudert at gcc dot gnu dot org 2007-09-30 22:28 --- The patch below should provide fallback functions (build in maintainer mode or use autoreconf in libgfortran), does it work? Index: intrinsics/c99_functions.c === --- intrinsics/c99_functions.c (revision 128673) +++ intrinsics/c99_functions.c (working copy) @@ -168,6 +168,31 @@ erfcf (float x) #endif +/* Wrappers for systems without the C99 gammaf() and lgammaf() functions. */ + +#if defined(HAVE_GAMMA) && !defined(HAVE_GAMMAF) +#define HAVE_GAMMAF 1 +extern float gammaf (float); + +float +gammaf (float x) +{ + return (float) gamma ((double) x); +} +#endif + +#if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF) +#define HAVE_LGAMMAF 1 +extern float lgammaf (float); + +float +lgammaf (float x) +{ + return (float) lgamma ((double) x); +} +#endif + + #ifndef HAVE_ACOSF #define HAVE_ACOSF 1 float Index: c99_protos.h === --- c99_protos.h(revision 128673) +++ c99_protos.h(working copy) @@ -284,6 +284,19 @@ extern float erfcf (float); #endif +/* Wrappers for systems without the C99 gammaf() and lgammaf() functions. */ + +#if defined(HAVE_GAMMA) && !defined(HAVE_GAMMAF) +#define HAVE_GAMMAF 1 +extern float gammaf (float); +#endif + +#if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF) +#define HAVE_LGAMMAF 1 +extern float lgammaf (float); +#endif + + /* log10l is needed on all platforms for decimal I/O */ #ifndef HAVE_LOG10L Index: configure.ac === --- configure.ac(revision 128673) +++ configure.ac(working copy) @@ -379,6 +379,10 @@ AC_CHECK_LIB([m],[y1l],[AC_DEFINE([HAVE_ AC_CHECK_LIB([m],[ynf],[AC_DEFINE([HAVE_YNF],[1],[libm includes ynf])]) AC_CHECK_LIB([m],[yn],[AC_DEFINE([HAVE_YN],[1],[libm includes yn])]) AC_CHECK_LIB([m],[ynl],[AC_DEFINE([HAVE_YNL],[1],[libm includes ynl])]) +AC_CHECK_LIB([m],[gamma],[AC_DEFINE([HAVE_GAMMA],[1],[libm includes gamma])]) +AC_CHECK_LIB([m],[gammaf],[AC_DEFINE([HAVE_GAMMAF],[1],[libm includes gammaf])] ) +AC_CHECK_LIB([m],[lgamma],[AC_DEFINE([HAVE_LGAMMA],[1],[libm includes lgamma])] ) +AC_CHECK_LIB([m],[lgammaf],[AC_DEFINE([HAVE_LGAMMAF],[1],[libm includes lgammaf ])]) # On AIX, clog is present in libm as __clog AC_CHECK_LIB([m],[__clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])]) -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added CC||fxcoudert at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #5 from dave at hiauly1 dot hia dot nrc dot ca 2007-09-30 22:31 --- Subject: Re: FAIL: gfortran.dg/gamma_1.f90 > The patch below should provide fallback functions (build in maintainer mode or > use autoreconf in libgfortran), does it work? I'll give this a whirl after the current build and check completes... Dave -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #6 from tkoenig at gcc dot gnu dot org 2007-10-24 19:30 --- I'll do this together with PR 33698. -- tkoenig at gcc dot gnu dot org changed: What|Removed |Added BugsThisDependsOn||33698 AssignedTo|unassigned at gcc dot gnu |tkoenig at gcc dot gnu dot |dot org |org Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-10-24 19:30:32 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #7 from fxcoudert at gcc dot gnu dot org 2007-10-30 10:36 --- *** Bug 33942 has been marked as a duplicate of this bug. *** -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added CC||michael dot a dot richmond ||at nasa dot gov http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #8 from fxcoudert at gcc dot gnu dot org 2007-11-16 22:31 --- Subject: Bug 33583 Author: fxcoudert Date: Fri Nov 16 22:31:28 2007 New Revision: 130245 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130245 Log: PR libfortran/33583 PR libfortran/33698 * intrinsics/c99_functions.c (tgamma, tgammaf, lgamma, lgammaf): New fallback functions. * c99_protos.h (tgamma, tgammaf, lgamma, lgammaf): New prototypes. * configure.ac: Add checks for tgamma, tgammaf, tgammal, lgamma, lgammaf and lgammal. * config.h.in: Regenerate. * configure: Regenerate. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/c99_protos.h trunk/libgfortran/config.h.in trunk/libgfortran/configure trunk/libgfortran/configure.ac trunk/libgfortran/intrinsics/c99_functions.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #9 from fxcoudert at gcc dot gnu dot org 2007-11-16 22:46 --- I hope it's now fixed. If there is something more to it, please reopen the PR or file a new one. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
-- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Target Milestone|--- |4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #10 from michael dot a dot richmond at nasa dot gov 2007-11-26 17:18 --- Bug 33942 was marked as a duplicate of this one, but it is not fixed -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #11 from burnus at gcc dot gnu dot org 2007-11-26 17:42 --- (In reply to comment #10) > Bug 33942 was marked as a duplicate of this one, but it is not fixed Can you enlighten us what is missing? As a configure test was added, it should have found the lgamma function of "libm" and for gamma it should use the one provided by libgfortran. Do you get linker errors? Or what exactly is the error message/problem? -- burnus at gcc dot gnu dot org changed: What|Removed |Added CC||burnus at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #12 from fxcoudert at gcc dot gnu dot org 2007-11-26 17:58 --- (In reply to comment #10) > Bug 33942 was marked as a duplicate of this one, but it is not fixed PR33942 contains two different issues: first, that using GAMMA in your main program is calling the system gamma function, and not your internal gamma function: this one is, unfortunately, is a voluntary change in the behaviour of gfortran to conform to other compilers and the Fortran 2008 standard (or whatever its final name will be). You can get rid of that behaviour by adding "EXTERNAL GAMMA" to your main program, as I stated in my comment to PR33942. That first part is, as far as we are concerned, not a bug. It is noted in the 4.3 release notes (http://gcc.gnu.org/gcc-4.3/changes.html), along with the fact that adding "EXTERNAL GAMMA" is the way to go. The second half of the issue is that, on FreeBSD, there is no gammaf() in libm. This is what this PR tracks, and this is why PR33942 was closed as a duplicate. Sorry if that wasn't clear enough. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #13 from michael dot a dot richmond at nasa dot gov 2007-11-26 18:16 --- When I compile the following program under FreeBSD using the November 23 snapshot of gfortran: PROGRAM pgamma y = gamma(x) END PROGRAM pgamma I get the message: /var/tmp//ccuAsOud.o(.text+0x1f): In function `MAIN__': : undefined reference to `tgammaf' collect2: ld returned 1 exit status Is this the intended behavior? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #14 from burnus at gcc dot gnu dot org 2007-11-26 23:11 --- (In reply to comment #13) > When I compile the following program under FreeBSD using the November 23 > snapshot of gfortran: > : undefined reference to `tgammaf' > Is this the intended behavior? Of cause not. The question is only why does it happen. Did you compile GCC yourself? If yes, what do libgfortran/config.h and libgfortran/config.log contain for lgammaf? Are you sure that the linker finds the right version of libgfortran.so? (This feature was added 2007-11-16.) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #15 from kargl at gcc dot gnu dot org 2007-11-26 23:29 --- (In reply to comment #13) > When I compile the following program under FreeBSD using the November 23 > snapshot of gfortran: > > PROGRAM pgamma > y = gamma(x) > END PROGRAM pgamma > > I get the message: > > /var/tmp//ccuAsOud.o(.text+0x1f): In function `MAIN__': > : undefined reference to `tgammaf' > collect2: ld returned 1 exit status > > Is this the intended behavior? Works for me. troutmask:sgk[223] gc4x -o z a.f90 troutmask:sgk[224] nm z | grep gamma 00416060 T tgamma 00403b10 T tgammaf troutmask:sgk[225] gfc4x -v Using built-in specs. Target: x86_64-unknown-freebsd8.0 Configured with: ../gcc4x/configure --prefix=/home/sgk/work/4x --enable-languages=c,fortran Thread model: posix gcc version 4.3.0 20071126 (experimental) (GCC) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #16 from michael dot a dot richmond at nasa dot gov 2007-11-27 13:08 --- I am running the i386 version of FreeBSD 6.2. I compiled gcc myself. The only reference to lgammaf in libgfortran/config.h is: 490:/* libm includes lgammaf */ libgfortran/config.log contains the following references to lgammaf: configure:31736: checking for lgammaf in -lm configure:31771: /usr/home/mrichmon/gcc-4.3-20071123/g95/./gcc/xgcc -B/usr/home/mrichmon/gcc-4.3-20071123/g95/./gcc/ -B/home/mrichmon/irun/i386-unknown-freebsd6.2/bin/ -B/home/mrichmon/irun/i386-unknown-freebsd6.2/lib/ -isystem /home/mrichmon/irun/i386-unknown-freebsd6.2/include -isystem /home/mrichmon/irun/i386-unknown-freebsd6.2/sys-include -o conftest -std=gnu99 -O2 -g conftest.c -lm >&5 conftest.c:196: warning: conflicting types for built-in function 'lgammaf' [snip] ac_cv_lib_m_lgammaf=yes The only version of libgfortran.so on my system is the one I create during the gfortran build. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #17 from kargl at gcc dot gnu dot org 2007-11-27 15:00 --- (In reply to comment #16) > I am running the i386 version of FreeBSD 6.2. I compiled gcc myself. The only > reference to lgammaf in libgfortran/config.h is: > > 490:/* libm includes lgammaf */ > > libgfortran/config.log contains the following references to lgammaf: > > configure:31736: checking for lgammaf in -lm > configure:31771: /usr/home/mrichmon/gcc-4.3-20071123/g95/./gcc/xgcc > -B/usr/home/mrichmon/gcc-4.3-20071123/g95/./gcc/ g95? How do you retrieve your source? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #18 from michael dot a dot richmond at nasa dot gov 2007-11-27 15:28 --- I retrieve my source with the following commands: wget --timestamping ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/snapshots/4.3-20071123/gcc-core-4.3-20071123.tar.bz2 wget --timestamping ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/snapshots/4.3-20071123/gcc-fortran-4.3-20071123.tar.bz2 It is my understanding that I am supposed to create a separate directory under gcc-4.3-20071123 for building gcc. I chose the name "g95" out of habit; I was not building the g95 compiler. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #19 from kargl at gcc dot gnu dot org 2007-11-27 19:42 --- Michael, I found a part of the problem. First, I grabbed the tarballs you specified and built gcc/gfortran in a directory as you stated. The reason I did not see a problem previously is because I always add -static to my options. A quick check shows troutmask:sgk[239] nm libgfortran.a | grep tgamma U tgamma T tgammaf troutmask:sgk[240] nm --dynamic libgfortran.so.3 | grep tgamma U tgamma Thus, the tgammaf symbol is missing in the shared library. I have no idea at the moment why it does not appear in the shared lib. Of course, libtools is a complete mystery to me. -- kargl at gcc dot gnu dot org changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #20 from kargl at gcc dot gnu dot org 2007-11-27 20:28 --- OK, I've found the problem. tgammaf has not been added to gfortran.map. I suspect that there may be other symbols missing from gfortran.map. Unfortunately, I don't know enough about symbol versioning to determine if tgammaf needs to be just added or if it needs to be added on an as needed basis. This is probably a question for Janne? -- kargl at gcc dot gnu dot org changed: What|Removed |Added CC||kargl at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #21 from fxcoudert at gcc dot gnu dot org 2007-11-27 21:51 --- (In reply to comment #20) > OK, I've found the problem. tgammaf has not been added to > gfortran.map. Yuck. I should have remembered that :( > I don't know > enough about symbol versioning to determine if tgammaf > needs to be just added or if it needs to be added on an > as needed basis. It can be added unconditionnaly. (I asked Jane last time I added a fallback function.) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #22 from jvdelisle at gcc dot gnu dot org 2007-11-30 04:14 --- Subject: Bug 33583 Author: jvdelisle Date: Fri Nov 30 04:14:01 2007 New Revision: 130531 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130531 Log: 2007-11-29 Steven G. Kargl <[EMAIL PROTECTED]> PR libfortran/33583 * libgfortran/gfortran.map: Add tgammaf, tgamma, lgamma, and lgammaf. * gfortran.dg/gamma_5.f90: Remove xfail. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/gfortran.map -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583
[Bug libfortran/33583] FAIL: gfortran.dg/gamma_1.f90
--- Comment #23 from fxcoudert at gcc dot gnu dot org 2007-11-30 09:27 --- This time it can probably be marked as fixed. Please reopen it if the problem persists. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33583