https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129237
Bug ID: 129237
Summary: ice in gfc_get_class_from_expr
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: ---
Created attachment 66371
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=66371&action=edit
f90 source code
The attached F90 code, from the llvm flang testsuite on github.com,
does this with recent flang:
$ flang -c -w
/home/dcb42/llvm/trunk/flang/test/Lower/HLFIR/elemental-polymorphic-merge.f90
$
gfortran-16.2.0 isn't so happy with it:
$ ~/gcc/results.16.2.0/bin/gfortran -c -w
/home/dcb42/llvm/trunk/flang/test/Lower/HLFIR/elemental-polymorphic-merge.f90
/home/dcb42/llvm/trunk/flang/test/Lower/HLFIR/elemental-polymorphic-merge.f90:10:20:
10 | r = merge(x, y, m)
| 1
internal compiler error: Segmentation fault
0x20475b7 internal_error
/home/dcb42/gcc/working.2/gcc/../../gcc-16.2.0/gcc/diagnostic-global-context.cc:787
0xce9939 ???
/home/dcb42/gcc/working.2/gcc/../../gcc-16.2.0/gcc/toplev.cc:325
0x57e31e gfc_get_class_from_expr
/home/dcb42/gcc/working.2/gcc/../../gcc-16.2.0/gcc/fortran/trans-expr.cc:0
0x55538e gfc_alloc_allocatable_for_assignment
/home/dcb42/gcc/working.2/gcc/../../gcc-16.2.0/gcc/fortran/trans-array.cc:12355
gfortran trunk does something similar.