]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Fix ICE with structure constructor in data statement [PR79685]
authorPaul Thomas <pault@gcc.gnu.org>
Fri, 25 Oct 2024 16:59:03 +0000 (17:59 +0100)
committerPaul Thomas <pault@gcc.gnu.org>
Fri, 1 Nov 2024 10:27:44 +0000 (10:27 +0000)
commit9a5ee8da09b705fc2a4197453789db0749387db3
treefaa87c90aab92a811f139ddb8eb9cc52f2b62e96
parentdf542909224a7ff88b204534ad035a0b216a98bf
Fortran: Fix ICE with structure constructor in data statement [PR79685]

2024-10-25  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/79685
* decl.cc (match_data_constant): Find the symtree instead of
the symbol so the use renamed symbols are found. Pass this and
the derived type to gfc_match_structure_constructor.
* match.h: Update prototype of gfc_match_structure_contructor.
* primary.cc (gfc_match_structure_constructor): Remove call to
gfc_get_ha_sym_tree and use caller supplied symtree instead.

gcc/testsuite/
PR fortran/79685
* gfortran.dg/use_rename_13.f90: New test.

(cherry picked from commit 6cb1da72cac166bd3b005c0430557b68b9761da5)
gcc/fortran/decl.cc
gcc/fortran/match.h
gcc/fortran/primary.cc
gcc/testsuite/gfortran.dg/use_rename_13.f90 [new file with mode: 0644]