Patch to gfortran PR13433

Paul Brook
Sun Feb 15 17:46:00 GMT 2004

On Sunday 15 February 2004 11:40 am, Victor Leikehman wrote:
> This patch fixes gfortran/13433 aka "ICE in assumed-length
> character function".
> (

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

> 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.
>         G = "HELLO"
>       END
>         F = "WORLD"
>       END
>       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.


2004-02-15  Victor Leikehman  <>

	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  <>

	PR gfortran/13433
	* gfortran.fortran-torture/execute/straret.f90: New test.

More information about the Gcc-patches mailing list