------- Comment #3 from burnus at gcc dot gnu dot org 2008-01-19 12:43 ------- Without -ff2c, gfortran uses (-fdump-tree-original): complex(kind=8) __result_f; __result_f = __complex__ (0.0, 0.0);
but for -ff2c it looks odd: f (a) { complex(kind=8) __result_f; *__result_f = 0.0; return __result_f; } Besides, the complex result should not be returned as function result but as additional parameter. At least this is what the gfortran manual claims: "The calling conventions used by g77 (originally implemented in f2c) require functions that return type default REAL to actually return the C type double, and functions that return type COMPLEX to return the values via an extra argument in the calling sequence that points to where to store the return value" g77 manual: http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Functions.html But it would be better if you could avoid the option -ff2c; it is much less tested, incompatible to almost all other Fortran compilers including g77 with the -fno-f2c compiler option. -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- GCC build triplet|powerpc-apple-darwin8.10.0 | GCC host triplet|powerpc-apple-darwin8.11.0 | GCC target triplet|powerpc-apple-darwin8.10.0 | Last reconfirmed|2008-01-19 12:11:47 |2008-01-19 12:43:02 date| | Summary|Internal error compiler |ICE with -ff2c for function |errror appears with -ff2c |returning a complex number http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34868