[PATCH] Fortran : Two further previously missed ICEs PR53298

Mark Eggleston mark.eggleston@codethink.co.uk
Tue Oct 13 07:26:27 GMT 2020


**ping**

see https://gcc.gnu.org/pipermail/gcc-patches/2020-September/554034.html 
and https://gcc.gnu.org/pipermail/gcc-patches/2020-September/555072.html

OK for master?

On 14/09/2020 08:22, Mark Eggleston wrote:
> Second attempt this time with patch attached.
>
> For review.
>
> Fixes the two ICEs reported in PR that remained after the previous fix.
>
> There is a side affect that is manifested in the tree dumps. Instead of
>
> __builtin_free (ptr2->dat.data);
>
> we get
>
> __builtin_free ((void *) ptr2->dat.data);
>
> I do not know the cause of this but from what I can tell the newly 
> inserted cast is harmless.  All the examples I've seen so have the 
> cast except where the parameter is declared as void *. In the tree 
> dumps ptr2 is declared as struct testtype2 *, I do not know where the 
> type is declared so I don't know whether data is declared void * (I 
> expect it is).
>
> Is it worth the effort to determine how to remove the extra (void *)?
>
> [PATCH] Fortran  : Two further previously missed ICEs PR53298
>
> There were 3 ICEs with different call stacks in the comments of this
> PR.  A previous commit fixed only one of those ICEs.
>
> The ICEs fixed here are in trans-array.c and trans-expr.c.
>
> The first ICE occurred when the array reference is not AR_ELEMENT
> gfc_conv_scalarized_array_ref is called with se and ar, if se->ss is
> NULL the ICE occurs.  If se->ss is NULL there is nothing to do before
> the return.
>
> The second ICE occurs in code that did not match its comments. Fixing
> the code to match the comments fixes the ICE.  A side affect is that
> the in the tree dumps for finalize_35.f90 and finalize_36.f90 contain
> "__builtin_free ((void *) ptr2->dat.data);", the "(void *)" was
> previously omitted.  The cast is harmless.
>
> 2020-09-11  Mark Eggleston <markeggleston@gcc.gnu.org>
>
> gcc/fortran/
>
>     PR fortran/53298
>     * trans-array.c (gfc_conv_array_ref): In the body of the if
>     statement only execute the code before the reurn is se->ss is
>     set.
>     * trans-expr.c (gfc_conv_component_ref): Change the if
>     expression to match the comments.
>
> 2020-09-04  Mark Eggleston <markeggleston@gcc.gnu.org>
>
> gcc/testsuite/
>
>     PR fortran/53298
>     * gfortran.dg/finalize_35.f90: Handle extra (void *).
>     * gfortran.dg/finalize_36.f90: Handle extra (void *).
>     * gfortran.dg/pr53298_2.f90: New test.
>     * gfortran.dg/pr53298_3.f90: New test.
>
-- 
https://www.codethink.co.uk/privacy.html



More information about the Gcc-patches mailing list