https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81111
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-06-16 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Reduced: template<typename _Value> struct __numeric_traits_integer { static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0); }; template<typename _Value> const _Value __numeric_traits_integer<_Value>::__min; void f() { __numeric_traits_integer<unsigned long long>::__min; } $ /home/jwakely/src/gcc/build/gcc/cc1plus -fsanitize=undefined -m32 -quiet ice.cc ice.cc: In instantiation of ‘const long long unsigned int __numeric_traits_integer<long long unsigned int>::__min’: ice.cc:13:49: required from here ice.cc:5:65: internal compiler error: Segmentation fault static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0); ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0xde006f crash_signal /home/jwakely/src/gcc/gcc/gcc/toplev.c:338 0xb2ba10 tree_check(tree_node*, char const*, int, char const*, tree_code) /home/jwakely/src/gcc/gcc/gcc/tree.h:3082 0xb2ba10 gimple_body(tree_node*) /home/jwakely/src/gcc/gcc/gcc/gimple-expr.c:317 0xb538a4 gimple_add_tmp_var(tree_node*) /home/jwakely/src/gcc/gcc/gcc/gimplify.c:753 0xb2c1ea create_tmp_var(tree_node*, char const*) /home/jwakely/src/gcc/gcc/gcc/gimple-expr.c:477 0xe02151 ubsan_encode_value(tree_node*, bool) /home/jwakely/src/gcc/gcc/gcc/ubsan.c:146 0x936fd4 ubsan_instrument_shift(unsigned int, tree_code, tree_node*, tree_node*) /home/jwakely/src/gcc/gcc/gcc/c-family/c-ubsan.c:215 0x8a960d cp_build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, int) /home/jwakely/src/gcc/gcc/gcc/cp/typeck.c:5282 0x671fca build_new_op_1 /home/jwakely/src/gcc/gcc/gcc/cp/call.c:6019 0x6730de build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*, tree_node*, tree_node**, int) /home/jwakely/src/gcc/gcc/gcc/cp/call.c:6064 0x89a252 build_x_binary_op(unsigned int, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node**, int) /home/jwakely/src/gcc/gcc/gcc/cp/typeck.c:3959 0x810657 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /home/jwakely/src/gcc/gcc/gcc/cp/pt.c:16921 0x812f16 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) /home/jwakely/src/gcc/gcc/gcc/cp/pt.c:17469 0x806f4e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) /home/jwakely/src/gcc/gcc/gcc/cp/pt.c:16534 0x801db0 regenerate_decl_from_template /home/jwakely/src/gcc/gcc/gcc/cp/pt.c:22419 0x801db0 instantiate_decl(tree_node*, bool, bool) /home/jwakely/src/gcc/gcc/gcc/cp/pt.c:22854 0x72831f maybe_instantiate_decl /home/jwakely/src/gcc/gcc/gcc/cp/decl2.c:4995 0x72af55 mark_used(tree_node*, int) /home/jwakely/src/gcc/gcc/gcc/cp/decl2.c:5094 0x86759a finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int) /home/jwakely/src/gcc/gcc/gcc/cp/semantics.c:3705 0x7a3603 cp_parser_primary_expression /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:5325 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.