https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88404
Bug ID: 88404 Summary: [9 Regression] ICE (tree check) with -fsanitize=thread on Fortran2003 code Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: janus at gcc dot gnu.org CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org Target Milestone: --- Simple test case (valid Fortran2003 code with unlimited polymorphism): program t type :: tString character(len=:), allocatable :: cs end type call test(getstr()) contains subroutine test(val) class(*), intent(in) :: val end subroutine function getstr() result(str) type(tString) :: str end function end gfortran versions 5 to 8 handle this well with -fsanitize=thread, but recent 9-trunk ICEs: during GIMPLE pass: tsan0 tsan_ice.f90:1:0: 1 | program t | internal compiler error: tree check: expected record_type or union_type or qual_union_type or array_type, have void_type in may_be_nonaddressable_p, at tree-ssa-loop-ivopts.c:2265 0x5c17c3 tree_check_failed(tree_node const*, char const*, int, char const*, ...) /home/janus/github/gcc/trunk/gcc/tree.c:9757 0xdfc6d6 tree_check4(tree_node*, char const*, int, char const*, tree_code, tree_code, tree_code, tree_code) /home/janus/github/gcc/trunk/gcc/tree.h:3218 0xdfc6d6 may_be_nonaddressable_p(tree_node*) /home/janus/github/gcc/trunk/gcc/tree-ssa-loop-ivopts.c:2265 0xcb14ea instrument_expr /home/janus/github/gcc/trunk/gcc/tsan.c:190 0xcb23dd instrument_gimple /home/janus/github/gcc/trunk/gcc/tsan.c:729 0xcb23dd instrument_memory_accesses /home/janus/github/gcc/trunk/gcc/tsan.c:802 0xcb23dd tsan_pass /home/janus/github/gcc/trunk/gcc/tsan.c:854 0xcb23dd execute /home/janus/github/gcc/trunk/gcc/tsan.c:905