https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128771
Bug ID: 128771
Summary: [17 Regression] ice in gfc_extract_hwi at
gcc/fortran/expr.cc:762
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
This F90 source code, from the Fujitsu test suite on github:
$ more /home/dcb42/fujitsu/trunk/Fortran/0566/0566_0003.f90
module m1
Type ty0(k1,k2)
Integer, kind :: k1,k2
character :: arr2(3) = [character(k2,k1)::'A','B','C']
End type
Type ty1(k1,k2)
Integer, kind :: k1,k2
character :: arr2(3) = [character(2,1)::'A','B','C']
End type
Type (ty0(1,1)):: obj4
Type (ty1(2,1)):: obj5
end module m1
use m1,only:aa=>obj5
use m1
if(any(aa%arr2 .ne. ['A','B','C']))print*,101
if(any(obj4%arr2 .ne. ['A','B','C']))print*,102
print*,"PASS"
End
$
does this with gfortran 16.2.0:
$ ~/gcc/results.16.2.0/bin/gfortran -c -w
/home/dcb42/fujitsu/trunk/Fortran/0566/0566_0003.f90
$
and this with recent trunk gfortran:
$ ~/gcc/results/bin/gfortran -c -w
/home/dcb42/fujitsu/trunk/Fortran/0566/0566_0003.f90
f951: internal compiler error: Segmentation fault
0x2129e07 internal_error
/home/dcb42/gcc/working/gcc/../../trunk/gcc/diagnostic-global-context.cc:787
0xd26179 ???
/home/dcb42/gcc/working/gcc/../../trunk/gcc/toplev.cc:325
0x4d8917 ???
/home/dcb42/gcc/working/gcc/../../trunk/gcc/fortran/primary.cc:3298
0x450e3e gfc_extract_hwi
/home/dcb42/gcc/working/gcc/../../trunk/gcc/fortran/expr.cc:762
0x410a15 gfc_resolve_character_array_constructor
/home/dcb42/gcc/working/gcc/../../trunk/gcc/fortran/array.cc:2436
Compiler is
$ ~/gcc/results/bin/gfortran -v
Using built-in specs.
COLLECT_GCC=/home/dcb42/gcc/results/bin/gfortran
COLLECT_LTO_WRAPPER=/home/dcb42/gcc/results.20261115.asan.ubsan/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../trunk/configure
--prefix=/home/dcb42/gcc/results.20261115.asan.ubsan --disable-analyzer
--disable-bootstrap --disable-doc --disable-fixincludes --disable-multilib
--with-build-config='bootstrap-asan bootstrap-ubsan'
--with-pkgversion=4182b22649d4682c --enable-checking=yes
--enable-languages=c,c++,fortran
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20261115 (experimental) (4182b22649d4682c)
foundBugs $
The bug first seems to appear sometime between g:15505d012872ddb4,
dated 20260731 and g:c5c5fe47a628c8d2, dated 20260901.