Here are some issues with array assignment to an allocatable CLASS(*) array using the current 8.0 trunk. class(*), allocatable :: x(:) x = [4,2] select type (x) type is (integer) if (any(x /= [4,2])) stop 1 end select end $ gfortran -g -fbacktrace gfortran-20180223a.f90 gfortran-20180223a.f90:1:0: class(*), allocatable :: x(:) Error: conversion of register to a different size VIEW_CONVERT_EXPR<void *>(_1); _12 = VIEW_CONVERT_EXPR<void *>(_1); gfortran-20180223a.f90:1:0: internal compiler error: verify_gimple failed 0xd2b9bd verify_gimple_in_seq(gimple*) ../../gcc/tree-cfg.c:5247 0xaa7495 gimplify_body(tree_node*, bool) ../../gcc/gimplify.c:12710 0xaa7684 gimplify_function_tree(tree_node*) ../../gcc/gimplify.c:12800 0x925d17 cgraph_node::analyze() ../../gcc/cgraphunit.c:670 0x9286b3 analyze_functions ../../gcc/cgraphunit.c:1131 0x9294a2 symbol_table::finalize_compilation_unit() ../../gcc/cgraphunit.c:2691 Please submit a full bug report,
And same example but using character data. This compiles but gives a segfault when run at the assignment statement. class(*), allocatable :: x(:) x = ['foo','bar'] select type (x) type is (character(*)) if (any(x /= ['foo','bar'])) stop 1 end select end $ gfortran -g gfortran-20180223b.f90 $ ./a.out Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7f40a5b0894f in ??? #1 0x400853 in MAIN__ at gfortran-20180223b.f90:2 #2 0x4009fd in main at gfortran-20180223b.f90:7 Segmentation fault (core dumped)
Confirmed, present since at least r245582.
> Confirmed, present since at least r245582. Forgot to say that the ICE requires a compiler configured with --enable-checking=yes.
Update with 8.2.0 The ICE is gone, but a run time segfault remains: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7f82986c06df in ??? #1 0x400754 in MAIN__ at gfortran-20180223a.f90:2 #2 0x400979 in main at gfortran-20180223a.f90:7 Segmentation fault (core dumped)
This seems fixed after revision r265283. Likely a duplicate of pr87625. *** This bug has been marked as a duplicate of bug 87625 ***