]> gcc.gnu.org Git - gcc.git/commit
Fortran: fix bounds-checking errors for CLASS array dummies [PR104908]
authorHarald Anlauf <anlauf@gmx.de>
Sat, 27 Jan 2024 16:41:43 +0000 (17:41 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Fri, 9 Feb 2024 19:45:07 +0000 (20:45 +0100)
commit07b575d5860dbc8791dbb9d10af9f918f34d7ff0
tree5df6f8e6e35c14e58550d95242b027bf52d8dade
parent010e4a04c4daaf1b0dacf6aa30fcbdaa73eda33c
Fortran: fix bounds-checking errors for CLASS array dummies [PR104908]

Commit r11-1235 addressed issues with bounds of unlimited polymorphic array
dummies.  However, using the descriptor from sym->backend_decl does break
the case of CLASS array dummies.  The obvious solution is to restrict the
fix to the unlimited polymorphic case, thus keeping the original descriptor
in the ordinary case.

gcc/fortran/ChangeLog:

PR fortran/104908
* trans-array.c (gfc_conv_array_ref): Restrict use of transformed
descriptor (sym->backend_decl) to the unlimited polymorphic case.

gcc/testsuite/ChangeLog:

PR fortran/104908
* gfortran.dg/pr104908.f90: New test.

(cherry picked from commit ce61de1b8a1bb3a22118e900376f380768f2ba59)
gcc/fortran/trans-array.c
gcc/testsuite/gfortran.dg/pr104908.f90 [new file with mode: 0644]
This page took 0.06468 seconds and 6 git commands to generate.