https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92174
Bug ID: 92174
Summary: runtime error: index 15 out of bounds for type
'gfc_expr *[15]
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
Blocks: 63426
Target Milestone: ---
Happens with UBSAN build in:
$ ./xgcc -B. /home/marxin/Programming/gcc/gcc/testsuite/gfortran.dg/pr91802.f90
-fcoarray=single
../../gcc/fortran/array.c:867:36: runtime error: index 15 out of bounds for
type 'gfc_expr *[15]'
#0 0x8b40d6 in gfc_set_array_spec(gfc_symbol*, gfc_array_spec*, locus*)
../../gcc/fortran/array.c:867
#1 0x953b29 in attr_decl1 ../../gcc/fortran/decl.c:8521
#2 0x95406c in attr_decl ../../gcc/fortran/decl.c:8582
#3 0x9549f2 in gfc_match_codimension() ../../gcc/fortran/decl.c:8855
#4 0xaf2ff4 in match_word ../../gcc/fortran/parse.c:65
#5 0xaf4825 in decode_statement ../../gcc/fortran/parse.c:464
#6 0xafaa00 in next_free ../../gcc/fortran/parse.c:1272
#7 0xafb459 in next_statement ../../gcc/fortran/parse.c:1504
#8 0xb03ad7 in parse_spec ../../gcc/fortran/parse.c:3902
#9 0xb0d9d4 in parse_module ../../gcc/fortran/parse.c:6085
#10 0xb0f9f4 in gfc_parse_file() ../../gcc/fortran/parse.c:6390
#11 0xc7db45 in gfc_be_parse_file ../../gcc/fortran/f95-lang.c:208
#12 0x23dbbc5 in compile_file ../../gcc/toplev.c:456
#13 0x23e39ec in do_compile ../../gcc/toplev.c:2167
#14 0x23e401b in toplev::main(int, char**) ../../gcc/toplev.c:2302
#15 0x491ff6a in main ../../gcc/main.c:39
#16 0x7fd8f53b3e0a in __libc_start_main ../csu/libc-start.c:308
#17 0x89d1e9 in _start
(/home/marxin/Programming/gcc2/objdir/gcc/f951+0x89d1e9)
../../gcc/fortran/array.c:868:36: runtime error: index 15 out of bounds for
type 'gfc_expr *[15]'
#0 0x8b42cf in gfc_set_array_spec(gfc_symbol*, gfc_array_spec*, locus*)
../../gcc/fortran/array.c:868
#1 0x953b29 in attr_decl1 ../../gcc/fortran/decl.c:8521
#2 0x95406c in attr_decl ../../gcc/fortran/decl.c:8582
#3 0x9549f2 in gfc_match_codimension() ../../gcc/fortran/decl.c:8855
#4 0xaf2ff4 in match_word ../../gcc/fortran/parse.c:65
#5 0xaf4825 in decode_statement ../../gcc/fortran/parse.c:464
#6 0xafaa00 in next_free ../../gcc/fortran/parse.c:1272
#7 0xafb459 in next_statement ../../gcc/fortran/parse.c:1504
#8 0xb03ad7 in parse_spec ../../gcc/fortran/parse.c:3902
#9 0xb0d9d4 in parse_module ../../gcc/fortran/parse.c:6085
#10 0xb0f9f4 in gfc_parse_file() ../../gcc/fortran/parse.c:6390
#11 0xc7db45 in gfc_be_parse_file ../../gcc/fortran/f95-lang.c:208
#12 0x23dbbc5 in compile_file ../../gcc/toplev.c:456
#13 0x23e39ec in do_compile ../../gcc/toplev.c:2167
#14 0x23e401b in toplev::main(int, char**) ../../gcc/toplev.c:2302
#15 0x491ff6a in main ../../gcc/main.c:39
#16 0x7fd8f53b3e0a in __libc_start_main ../csu/libc-start.c:308
#17 0x89d1e9 in _start
(/home/marxin/Programming/gcc2/objdir/gcc/f951+0x89d1e9)
...
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63426
[Bug 63426] [meta-bug] Issues found with -fsanitize=undefined