This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to gfortran PR13433
- From: Paul Brook <paul at codesourcery dot com>
- To: Victor Leikehman <LEI at il dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org
- Date: Sun, 15 Feb 2004 16:49:41 +0000
- Subject: Re: Patch to gfortran PR13433
- Organization: CodeSourcery
- References: <OF73D5FDFF.772B81B6-ON42256E3B.003C2278-42256E3B.004025F8@il.ibm.com>
On Sunday 15 February 2004 11:40 am, Victor Leikehman wrote:
> This patch fixes gfortran/13433 aka "ICE in assumed-length
> character function".
> (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13433)
Applied, thanks. Something seems to have mangled the whitespace in the patch,
so I made the changes by hand.
In future please put ChangeLog entries in plain test in the body of the email,
not as part of the patch. Patches to gfortran should also be copied to
fortran@gcc.gnu.org.
> For functions returning CHARACTER, calling conventions
> changed to comply with g77.
>
> Follows an example that used to trigger the ICE;
> now prints HELLO WORLD as expected.
>
> CHARACTER*11 FUNCTION G()
> G = "HELLO"
> END
>
> CHARACTER*(*) FUNCTION F()
> F = "WORLD"
> END
>
> PROGRAM MAIN
> CHARACTER*5 F,G
> PRINT*, G(), ' ', F()
> END
>
> Victor
The above gode is illegal. It can (and does) cause memory corruption. The
dummy result for G() is larger then the actual result.
Paul
2004-02-15 Victor Leikehman <lei@il.ibm.com>
PR gfortran/13433
* trans-decl.c (gfc_build_function_decl) For functions
returning CHARACTER*(*) pass an extra length argument,
following g77 calling conventions.
* trans-types.c (gfc_get_function_type) Ditto.
* trans-expr.c (gfc_conv_function_call) Ditto.
2004-02-15 Paul Brook <paul@codesourcery.com>
PR gfortran/13433
* gfortran.fortran-torture/execute/straret.f90: New test.