This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix gfortran ICE with a call to alternate return subroutine(take 2)
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Tue, 07 Jun 2005 21:55:14 +0200
- Subject: Re: [PATCH] Fix gfortran ICE with a call to alternate return subroutine(take 2)
- References: <20050523133905.GG4930@devserv.devel.redhat.com> <20050606195528.GV22349@devserv.devel.redhat.com>
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.