[Bug fortran/114021] ICE with allocation of scalar pointer entity where SOURCE=f() with f() returning a pointer
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Aug 16 11:59:55 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114021
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Paul Thomas <pault@gcc.gnu.org>:
https://gcc.gnu.org/g:ca85bd3e8a1f44ac61800e3f4ec4e93356e9065a
commit r15-11479-gca85bd3e8a1f44ac61800e3f4ec4e93356e9065a
Author: Paul Thomas <pault@gcc.gnu.org>
Date: Fri Mar 27 10:50:39 2026 +0000
Fortran: Fix ICE with allocation of scalar pointer entity [PR114021]
2026-03-27 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran
PR fortran/114021
* symbol.cc (gfc_get_unique_symtree): If the namespace argument
is NULL, allocate a new symtree and provide it with the unique
name.
* trans-expr.cc (trans_scalar_assign): In the deep copy of a
derived type with allocatable components, fix the rhs value if
it is not a constant or a variable.
* trans-stmt.cc (gfc_trans_allocate): Do not deallocate
allocatable components of a source that is not a variable and
is a pointer. If the DECL_NAME or its IDENTIFIER_POINTER are
null,use gfc_get_unique_symtree with NULL namespace to obtain a
symtree for the assignment.
gcc/testsuite/
PR fortran/114021
* gfortran.dg/pr114021.f90: New test.
(cherry picked from commit e3cd8908019f4c023e6494fcd4a5acb60f98ed63)
More information about the Gcc-bugs
mailing list