]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: improve checking of array specifications
authorHarald Anlauf <anlauf@gmx.de>
Thu, 2 Dec 2021 21:33:49 +0000 (22:33 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Fri, 3 Dec 2021 20:07:55 +0000 (21:07 +0100)
commitf46d32dd29b7623915e31b0508e2e925526fa7d8
treec4b1148f1ca7351c74dd2fa8e00262ad61f6925d
parentabd7712f91c99690f8b0046ea168b2782afbac69
Fortran: improve checking of array specifications

gcc/fortran/ChangeLog:

PR fortran/103505
* array.c (match_array_element_spec): Try to simplify array
element specifications to improve early checking.
* expr.c (gfc_try_simplify_expr): New.  Try simplification of an
expression via gfc_simplify_expr.  When an error occurs, roll
back.
* gfortran.h (gfc_try_simplify_expr): Declare it.

gcc/testsuite/ChangeLog:

PR fortran/103505
* gfortran.dg/pr103505.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
gcc/fortran/array.c
gcc/fortran/expr.c
gcc/fortran/gfortran.h
gcc/testsuite/gfortran.dg/pr103505.f90 [new file with mode: 0644]