https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77823
Bug ID: 77823
Summary: [7 Regression] ICE: in ubsan_encode_value, at
ubsan.c:137 with -fsanitize=undefined and vector types
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: sanitizer
Assignee: unassigned at gcc dot gnu.org
Reporter: zsojka at seznam dot cz
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
Target Milestone: ---
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build: x86_64-pc-linux-gnu
Created attachment 39734
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39734&action=edit
reduced testcase
Compiler output:
$ x86_64-pc-linux-gnu-gcc -fsanitize=undefined -Wno-psabi testcase.c
testcase.c: In function 'foov':
testcase.c:7:3: internal compiler error: in ubsan_encode_value, at ubsan.c:137
return v << 30;
^~~~~~
0xc0647c ubsan_encode_value(tree_node*, bool)
/repo/gcc-trunk/gcc/ubsan.c:137
0x6eac0b ubsan_instrument_shift(unsigned int, tree_code, tree_node*,
tree_node*)
/repo/gcc-trunk/gcc/c-family/c-ubsan.c:192
0x628bc9 build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, int)
/repo/gcc-trunk/gcc/c/c-typeck.c:11764
0x62d3b3 parser_build_binary_op(unsigned int, tree_code, c_expr, c_expr)
/repo/gcc-trunk/gcc/c/c-typeck.c:3616
0x63dab3 c_parser_binary_expression
/repo/gcc-trunk/gcc/c/c-parser.c:6855
0x63dea5 c_parser_conditional_expression
/repo/gcc-trunk/gcc/c/c-parser.c:6495
0x63e5a0 c_parser_expr_no_commas
/repo/gcc-trunk/gcc/c/c-parser.c:6412
0x63ec32 c_parser_expression
/repo/gcc-trunk/gcc/c/c-parser.c:8608
0x63f639 c_parser_expression_conv
/repo/gcc-trunk/gcc/c/c-parser.c:8641
0x65956f c_parser_statement_after_labels
/repo/gcc-trunk/gcc/c/c-parser.c:5334
0x65ae01 c_parser_compound_statement_nostart
/repo/gcc-trunk/gcc/c/c-parser.c:4944
0x65b65e c_parser_compound_statement
/repo/gcc-trunk/gcc/c/c-parser.c:4777
0x657053 c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.c:2176
0x662a03 c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.c:1574
0x663489 c_parser_translation_unit
/repo/gcc-trunk/gcc/c/c-parser.c:1454
0x663489 c_parse_file()
/repo/gcc-trunk/gcc/c/c-parser.c:18173
0x6ca0e2 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.c:1072
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-240623-checking-yes-rtl-df-extra-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-240623-checking-yes-rtl-df-extra-nographite-amd64
Thread model: posix
gcc version 7.0.0 20160929 (experimental) (GCC)
The failing line is:
ubsan.c
134: return fold_convert (pointer_sized_int_node, t);
135: }
136: default:
137: gcc_unreachable ();
138: }
139: else
140: {