This patch fixes bootstrap failure in ligfortran/instrisics/c99_functions.c for mips-sgi-irix6.5. This patch applies cleanly to 4.1 and mainline. It's similiar as http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01578.html Patch applied, bootstrap finished successfully for 4.1 svn revision 110639. Testsuite in progress.
There is one open question. Is the "#ifdef __sgi__" the right way to distinguish between IRIX and other mips systems? I ask for comments. Best regards Rainer --- gcc-4.1-svn/libgfortran/intrinsics/c99_functions.c 2006-01-17 22:12:03.000000000 +0100 +++ gcc-4.1-test/libgfortran/intrinsics/c99_functions.c 2006-02-06 19:42:39.000000000 +0100 @@ -35,6 +35,22 @@ Boston, MA 02110-1301, USA. */ #define C99_PROTOS_H WE_DONT_WANT_PROTOS_NOW #include "libgfortran.h" +/* IRIX's <math.h> declares a non-C99 compliant implementation of cabs, + which takes two floating point arguments instead of a single complex. + If <complex.h> is missing this prevents building of c99_functions.c. + To work around this we redirect cabs{,f,l} calls to __gfc_cabs{,f,l}. */ + +#ifdef __sgi__ +#ifndef HAVE_COMPLEX_H +#undef HAVE_CABS +#undef HAVE_CABSF +#undef HAVE_CABSL +#define cabs __gfc_cabs +#define cabsf __gfc_cabsf +#define cabsl __gfc_cabsl +#endif /* HAVE_COMPLEX_H */ +#endif /* __sgi__ */ + /* Tru64's <math.h> declares a non-C99 compliant implementation of cabs, which takes two floating point arguments instead of a single complex. To work around this we redirect cabs{,f,l} calls to __gfc_cabs{,f,l}. */