]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Fix missing substring ref for allocatable saved vars [PR120483]
authorAndre Vehreschild <vehre@gcc.gnu.org>
Mon, 2 Jun 2025 08:41:48 +0000 (10:41 +0200)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Wed, 4 Jun 2025 07:22:08 +0000 (09:22 +0200)
commitafa2de8093a0cd47394df42c7092aa6a357d2f9c
tree53db096697a28b9d3349bcf631303597e6164abc
parentf8251b4fce20f030fb133de1cadb06f95f01656e
Fortran: Fix missing substring ref for allocatable saved vars [PR120483]

Compute a substring ref on an allocatable static character array
using pointer arithmetic.  Using an array type corrupts type
layouting and crashes omp generation.

PR fortran/120483

gcc/fortran/ChangeLog:

* trans-expr.cc (gfc_conv_substring): Use pointer arithmetic on
static allocatable char arrays.

gcc/testsuite/ChangeLog:

* gfortran.dg/save_8.f90: New test.
gcc/fortran/trans-expr.cc
gcc/testsuite/gfortran.dg/save_8.f90 [new file with mode: 0644]