]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: improve check of pointer initialization in DATA statements
authorHarald Anlauf <anlauf@gmx.de>
Wed, 9 Feb 2022 20:54:29 +0000 (21:54 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Sun, 20 Feb 2022 21:34:21 +0000 (22:34 +0100)
commite49508ac6b36adb8a2056c5a1fb6e0178de2439d
tree048885f0da1273e10c776209d068ff9e7288499d
parent1f96b5eeef10e19a6b44152e418f252fa676e292
Fortran: improve check of pointer initialization in DATA statements

gcc/fortran/ChangeLog:

PR fortran/77693
* data.cc (gfc_assign_data_value): If a variable in a data
statement has the POINTER attribute, check for allowed initial
data target that is compatible with pointer assignment.
* gfortran.h (IS_POINTER): New macro.

gcc/testsuite/ChangeLog:

PR fortran/77693
* gfortran.dg/data_pointer_2.f90: New test.
gcc/fortran/data.cc
gcc/fortran/gfortran.h
gcc/testsuite/gfortran.dg/data_pointer_2.f90 [new file with mode: 0644]