https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101624
Bug ID: 101624 Summary: [9/10/11/12 Regression] ICE: tree check: expected tree that contains 'decl with RTL' structure, have 'const_decl' in maybe_optimize_ubsan_ptr_ifn, at sanopt.c:495 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Started with r8 (gcc configured with --enable-checking=yes) : $ cat z1.f90 complex function f(x) complex, intent(in) :: x f = aimag(x) end program p complex, parameter :: a = (0.0, 1.0) complex :: b, f b = f(a) end $ gfortran-12-20210725 -c z1.f90 -O2 -fsanitize=undefined during GIMPLE pass: sanopt z1.f90:9:3: 9 | end | ^ internal compiler error: tree check: expected tree that contains 'decl with RTL' structure, have 'const_decl' in maybe_optimize_ubsan_ptr_ifn, at sanopt.c:495 0x65f003 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.c:8860 0xe6f6ba contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.h:3487 0xe6f6ba maybe_optimize_ubsan_ptr_ifn ../../gcc/sanopt.c:495 0xe6f6ba sanopt_optimize_walker ../../gcc/sanopt.c:837 0xe6d807 sanopt_optimize_walker ../../gcc/sanopt.c:885 0xe70e06 sanopt_optimize ../../gcc/sanopt.c:909 0xe70e06 execute ../../gcc/sanopt.c:1279