https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123947
Bug ID: 123947
Summary: [16 regression] crash in gfc_build_addr_expr
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
Created attachment 63564
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63564&action=edit
F90 source code
For the attached Fortran 90 code, from the Fujitsu compiler test suite at
https://github.com/fujitsu/compiler-test-suite
gfortran 15.2.0 seems fine:
fujitsu $ ~/gcc/results.15.2.0/bin/gfortran -c -w
trunk/Fortran/0264/0264_0002.f90
fujitsu $
but recent gfortran trunk seems less happy:
fujitsu $ ~/gcc/results.20260131.ubsan/bin/gfortran -c -w
trunk/Fortran/0264/0264_0002.f90
trunk/Fortran/0264/0264_0002.f90:34:34:
34 | ALLOCATE(OBJ_BASE%OBJ(2)%NODE6(3))
| 1
internal compiler error: Segmentation fault
0x1fc04b7 internal_error
/home/dcb42/gcc/working/gcc/../../trunk/gcc/diagnostic-global-context.cc:787
0xccc099 ???
/home/dcb42/gcc/working/gcc/../../trunk/gcc/toplev.cc:325
0x5321ee contains_struct_check
../../trunk/gcc/tree.h:3915
0x5321ee gfc_build_addr_expr
/home/dcb42/gcc/working/gcc/../../trunk/gcc/fortran/trans.cc:350
gfortran trunk from early in January 2026 doesn't seem happy either:
fujitsu $ ~/gcc/results.20260102.asan.ubsan/bin/gfortran -c -w
trunk/Fortran/0264/0264_0002.f90
trunk/Fortran/0264/0264_0002.f90:34:34:
34 | ALLOCATE(OBJ_BASE%OBJ(2)%NODE6(3))
| 1
internal compiler error: Segmentation fault
0x1ffc867 internal_error
/home/dcb42/gcc/working/gcc/../../trunk/gcc/diagnostic-global-context.cc:787
0xcdae49 ???
/home/dcb42/gcc/working/gcc/../../trunk/gcc/toplev.cc:325
0x5303ce contains_struct_check
../../trunk/gcc/tree.h:3905
0x5303ce gfc_build_addr_expr
/home/dcb42/gcc/working/gcc/../../trunk/gcc/fortran/trans.cc:348