[PATCH] Fix gfortran ICE with a call to alternate return subroutine (take 2)
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Tue Jun 7 19:55:00 GMT 2005
Jakub Jelinek wrote:
> Ok for HEAD and 4.0 once 4.0 branch reopens?
>
> 2005-06-06 Jakub Jelinek <jakub@redhat.com>
>
> * trans-expr.c (gfc_conv_function_call): Return int instead of
> void. Use a local variable for has_alternate_specifier and
> return it. Avoid modification of function type's return value
> in place, since it may be shared.
> * trans.h (has_alternate_specifier): Remove.
> (gfc_conv_function_call): Change return type.
> * trans-stmt.c (has_alternate_specifier): Remove.
> (gfc_trans_call): Add a local has_alternate_specifier variable,
> set it from gfc_conv_function_call return value.
>
> * gfortran.dg/altreturn_1.f90: New test.
OK. If we had a mechanism for generating artificial variables in the
frontend, this magic could probably be made much easier (*), but this is good
as well.
- Tobi
(*) essentially, replace
CALL SUB(*)
by
t = SUB ! this is the internal representation, not user code
SELECT CASE (t)
...
END SELECT
Currently we build the SELECT in the FE, but the connection between it and the
call is established only during code generation.
More information about the Fortran
mailing list