https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102541
Bug ID: 102541
Summary: [12 Regression] runtime error: load of value
208393040, which is not a valid value for type
'ar_type' since
r12-3897-g00f6de9c69119594f7dad3bd525937c94c8200d0
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
CC: burnus at gcc dot gnu.org
Blocks: 63426
Target Milestone: ---
The following is causing UBSAN:
$ cat ar.f90
type t
end type
class(T), allocatable :: ac(:)
call bar(ac)
contains
subroutine bar(x)
type(t) x(..)
end
end
$ /dev/shm/objdir2/gcc/xgcc -B /dev/shm/objdir2/gcc gcc/ar.f90 -c
/home/marxin/Programming/gcc2/gcc/fortran/trans-expr.c:6558:23: runtime error:
load of value 208393040, which is not a valid value for type 'ar_type'
#0 0x1127f3f in gfc_conv_procedure_call(gfc_se*, gfc_symbol*,
gfc_actual_arglist*, gfc_expr*, vec<tree_node*, va_gc, vl_embed>*)
/home/marxin/Programming/gcc2/gcc/fortran/trans-expr.c:6558
#1 0x1247a6c in gfc_trans_call(gfc_code*, bool, tree_node*, tree_node*,
bool) /home/marxin/Programming/gcc2/gcc/fortran/trans-stmt.c:425
#2 0xfe9298 in trans_code
/home/marxin/Programming/gcc2/gcc/fortran/trans.c:1986
#3 0xfe9a29 in gfc_trans_code(gfc_code*)
/home/marxin/Programming/gcc2/gcc/fortran/trans.c:2270
#4 0x10d2dbb in gfc_generate_function_code(gfc_namespace*)
/home/marxin/Programming/gcc2/gcc/fortran/trans-decl.c:6905
#5 0xfe9ac5 in gfc_generate_code(gfc_namespace*)
/home/marxin/Programming/gcc2/gcc/fortran/trans.c:2287
#6 0xdf8eca in translate_all_program_units
/home/marxin/Programming/gcc2/gcc/fortran/parse.c:6572
#7 0xdfa1e8 in gfc_parse_file()
/home/marxin/Programming/gcc2/gcc/fortran/parse.c:6841
#8 0xfa231c in gfc_be_parse_file
/home/marxin/Programming/gcc2/gcc/fortran/f95-lang.c:216
#9 0x2b0eb5a in compile_file /home/marxin/Programming/gcc2/gcc/toplev.c:458
#10 0x2b19eee in do_compile /home/marxin/Programming/gcc2/gcc/toplev.c:2233
#11 0x2b1a670 in toplev::main(int, char**)
/home/marxin/Programming/gcc2/gcc/toplev.c:2372
#12 0x7496c80 in main /home/marxin/Programming/gcc2/gcc/main.c:39
#13 0x7ffff6f1453f in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
#14 0x7ffff6f145eb in __libc_start_main_impl ../csu/libc-start.c:409
#15 0xb03274 in _start (/dev/shm/objdir2/gcc/f951+0xb03274)
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63426
[Bug 63426] [meta-bug] Issues found with -fsanitize=undefined