[PATCH] Fortran: ICE in simplification of array expression involving power [PR107680]

Mikael Morin morin-mikael@orange.fr
Wed Nov 16 11:39:28 GMT 2022


Le 15/11/2022 à 21:45, Harald Anlauf via Fortran a écrit :
> Dear all,
> 
> when constant expressions involve parentheses, array constructors,
> typespecs, and the power operator (**), we could fail with an ICE
> during simplification in arith_power.
> 
> Debugging of the testcase showed we call the proper type conversions
> needed for the arithmetic operation, but under certain circumstances
> we seem to lose the typespec on the way to the invocation of the
> simplification.  We then run into unhandled combinations of operand
> types.
> 
> The attached patch is likely a sort of a band-aid to the problem:
> we check the operand types in arith_power, and if we see that a
> conversion is (still) needed, we punt and defer the simplification.
> 
> AFAICT this is safe.  It does not address a possibly deeply
> covered issue in gfortran, which was suspected when analyzing
> pr107000.  But as this is elusive, that may be hard to locate
> and fix.
> 
> Regtested on x86_64-pc-linux-gnu.  OK for mainline?
> 
Yes, let's go with this.
Thanks for investigating.


More information about the Fortran mailing list