[Bug fortran/34868] ICE with -ff2c for function returning a complex number

2008-02-28 Thread fxcoudert at gcc dot gnu dot org
--- Comment #11 from fxcoudert at gcc dot gnu dot org 2008-02-28 15:44 --- Fixed on mainline. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added

[Bug fortran/34868] ICE with -ff2c for function returning a complex number

2008-02-28 Thread fxcoudert at gcc dot gnu dot org
--- Comment #10 from fxcoudert at gcc dot gnu dot org 2008-02-28 15:43 --- Subject: Bug 34868 Author: fxcoudert Date: Thu Feb 28 15:42:21 2008 New Revision: 132751 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132751 Log: PR fortran/34868 * trans-expr.c (gfc_c

[Bug fortran/34868] ICE with -ff2c for function returning a complex number

2008-02-28 Thread fxcoudert at gcc dot gnu dot org
--- Comment #9 from fxcoudert at gcc dot gnu dot org 2008-02-28 10:42 --- (In reply to comment #8) > There's more to it... using the "result" syntax for the function makes it fail > even with my patch That's because the result symbol is not marked with attr.always_explicit, only the pr

[Bug fortran/34868] ICE with -ff2c for function returning a complex number

2008-02-27 Thread fxcoudert at gcc dot gnu dot org
--- Comment #8 from fxcoudert at gcc dot gnu dot org 2008-02-27 14:51 --- There's more to it... using the "result" syntax for the function makes it fail even with my patch: function f(a) result(res) implicit none real(8), intent(in) :: a(:) complex(8) :: res res = cmplx(sum(a)

[Bug fortran/34868] ICE with -ff2c for function returning a complex number

2008-02-27 Thread fxcoudert at gcc dot gnu dot org
--- Comment #7 from fxcoudert at gcc dot gnu dot org 2008-02-27 10:35 --- Actually, after looking more in depth at the front-end code, we do a fairly good job of supporting the use of f2c calling conventions for Fortran 95 code (it's mainly handled by the use of sym->attr.always_explici

[Bug fortran/34868] ICE with -ff2c for function returning a complex number

2008-01-31 Thread fxcoudert at gcc dot gnu dot org
--- Comment #6 from fxcoudert at gcc dot gnu dot org 2008-01-31 15:36 --- That one is not a regression. It happens because, when the a argument is an assumed-shape array, gfc_return_by_reference() return 0 because sym->attr.always_explicit is set for the function. There are two interes

[Bug fortran/34868] ICE with -ff2c for function returning a complex number

2008-01-20 Thread burnus at gcc dot gnu dot org
--- Comment #5 from burnus at gcc dot gnu dot org 2008-01-21 07:41 --- > Then the resultant C source is >VOID f_(doublecomplex * ret_val, doublereal *a) Indeed this is f2c (and g77 -ff2c) syntax. > So it seems to me that the current functionality of the gfortran is different > from

[Bug fortran/34868] ICE with -ff2c for function returning a complex number

2008-01-20 Thread yamagen at coral dot t dot u-tokyo dot ac dot jp
--- Comment #4 from yamagen at coral dot t dot u-tokyo dot ac dot jp 2008-01-21 02:57 --- Thank you very much for your comments. First I answer to you why I would like to use -ff2c option. The reason is that I would like to use "-framework vecLib". In the URL http://developer.apple

[Bug fortran/34868] ICE with -ff2c for function returning a complex number

2008-01-19 Thread burnus at gcc dot gnu dot org
--- 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; ret