[Bug fortran/90744] [7/8/9/10 Regression] Bogus length for character temporaries passed to external procedures since r268992
tkoenig at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 6 18:41:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90744
--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to Tomáš Trnka from comment #3)
> I'm not sure how to fix this properly, but the following one-liner seems to
> work for me:
>
> --- a/gcc/fortran/trans-types.c
> +++ b/gcc/fortran/trans-types.c
> @@ -3006,6 +3006,7 @@ get_formal_from_actual_arglist (gfc_symbol *sym,
> gfc_actual_arglist *actual_args
> {
> s->ts = a->expr->ts;
> s->attr.flavor = FL_VARIABLE;
> + s->ts.deferred = false;
> if (a->expr->rank > 0)
> {
> s->attr.dimension = 1;
Good analysis, and this is indeed the correct fix.
(In this case, it is the actual argument that is deferred, it does
not make sense for the dummy argument to have the same attribute
in the absence of an explicit interface).
Do you have a gcc copyright assignment (and possibly commit privileges),
by any chance? If not, I'll commit your patch, as it is both
obvious and simple, and is definitely small enough so no
copyright assignment is needed.
Thanks!
More information about the Gcc-bugs
mailing list