Fortran: handle explicit-shape specs with constant bounds [PR105954]
authorHarald Anlauf <anlauf@gmx.de>
Mon, 20 Jun 2022 18:59:55 +0000 (20:59 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Thu, 30 Jun 2022 20:05:43 +0000 (22:05 +0200)
commit6bcab64467d7393d69bf5abd7b2a0aba22d2896e
treed3b72b2c5fec8b3e9dc94380f2d61c09964b338b
parent26ea506a1e8719f8b1f559e70bee9f5d3392eb37
Fortran: handle explicit-shape specs with constant bounds [PR105954]

gcc/fortran/ChangeLog:

PR fortran/105954
* decl.cc (variable_decl): Adjust upper bounds for explicit-shape
specs with constant bound expressions to ensure non-negative
extents.

gcc/testsuite/ChangeLog:

PR fortran/105954
* gfortran.dg/pr105954.f90: New test.

(cherry picked from commit a312407bd715647f7c11b67e0a52effc94d0f15d)
gcc/fortran/decl.cc
gcc/testsuite/gfortran.dg/pr105954.f90 [new file with mode: 0644]