Fortran: error recovery on invalid array section [PR108609]
authorHarald Anlauf <anlauf@gmx.de>
Wed, 1 Feb 2023 20:01:32 +0000 (21:01 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Wed, 1 Feb 2023 20:01:32 +0000 (21:01 +0100)
commit88a2a09dd4529107e7ef7a6e7ce43acf96457173
tree51decfe2710b4a2afbc11cc50e1874afc5db3630
parenta2c848c92c3f13c2dd9bd92d22beb44c1ff848b4
Fortran: error recovery on invalid array section [PR108609]

The testcase for PR108527 uncovered a latent issue with invalid array
sections that resulted in different paths being taken on different
architectures.  Detect the invalid array declaration for a clean recovery.

gcc/fortran/ChangeLog:

PR fortran/108609
* expr.cc (find_array_section): Add check to prevent interpreting an
mpz non-integer constant as an integer.

gcc/testsuite/ChangeLog:

PR fortran/108609
* gfortran.dg/pr108527.f90: Adjust test pattern.
gcc/fortran/expr.cc
gcc/testsuite/gfortran.dg/pr108527.f90