Fortran: incorrect array bounds when bound intrinsic used in decl [PR108131]
authorHarald Anlauf <anlauf@gmx.de>
Sat, 17 Dec 2022 21:04:32 +0000 (22:04 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Fri, 23 Dec 2022 21:23:10 +0000 (22:23 +0100)
commit6a95f0e0a06d78d94138d4c3dd64d41591197281
tree223e54217b2a9224018047fada3b7b188382ace2
parentcf59c8983ef6590f0d69014f8dc8778b5b7691c6
Fortran: incorrect array bounds when bound intrinsic used in decl [PR108131]

gcc/fortran/ChangeLog:

PR fortran/108131
* array.cc (match_array_element_spec): Avoid too early simplification
of matched array element specs that can lead to a misinterpretation
when used as array bounds in array declarations.

gcc/testsuite/ChangeLog:

PR fortran/108131
* gfortran.dg/pr103505.f90: Adjust expected patterns.
* gfortran.dg/pr108131.f90: New test.
gcc/fortran/array.cc
gcc/testsuite/gfortran.dg/pr103505.f90
gcc/testsuite/gfortran.dg/pr108131.f90 [new file with mode: 0644]