[PATCH] PR fortran/102817 - [12 Regression] ICE in gfc_clear_shape, at fortran/expr.c:422
Fri Nov 5 22:53:08 GMT 2021
Am 05.11.21 um 22:28 schrieb Mikael Morin:
> Le 01/11/2021 à 22:39, Harald Anlauf via Fortran a écrit :
>> Dear Fortranners,
>> a recent patch uncovered a latent issue with simplification of
>> array-valued expressions where the resulting shape was not set
>> from the referenced subobject. Once found, the fix looks obvious.
>> Regtested on x86_64-pc-linux-gnu. OK?
>> diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
>> index 4dea840e348..c5360dfaede 100644
>> --- a/gcc/fortran/expr.c
>> +++ b/gcc/fortran/expr.c
>> @@ -2129,6 +2129,7 @@ simplify_parameter_variable (gfc_expr *p, int type)
>> return false;
>> e->rank = p->rank;
>> + e->shape = gfc_copy_shape (p->shape, p->rank);
> I think e->shape can be non-null, and should be freed beforehand.
good point. I've added this and tested again.
See attached patch for the update.
> Ok with that change.
Thanks for the review!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1752 bytes
Desc: not available
More information about the Gcc-patches