https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84424
Bug ID: 84424 Summary: ICE on C++ code: tree check: expected record_type or union_type or qual_union_type, have vector_type in reduced_constant_expression_p, at cp/constexpr.c:1766 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- This seems to be a recent regression as the code is accepted by 7.2.0. $ g++tk -v Using built-in specs. COLLECT_GCC=g++tk COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap Thread model: posix gcc version 8.0.1 20180216 (experimental) [trunk revision 257739] (GCC) $ $ g++-7.2.0 -c tmp.cpp $ $ g++tk -c tmp.cpp tmp.cpp:4:42: internal compiler error: tree check: expected record_type or union_type or qual_union_type, have vector_type in reduced_constant_expression_p, at cp/constexpr.c:1766 constexpr vec v = __builtin_shuffle (v, u); ^ 0x63cd06 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc-source-trunk/gcc/tree.c:9337 0x70aefc tree_check3(tree_node*, char const*, int, char const*, tree_code, tree_code, tree_code) ../../gcc-source-trunk/gcc/tree.h:3172 0x70aefc reduced_constant_expression_p(tree_node*) ../../gcc-source-trunk/gcc/cp/constexpr.c:1766 0x70af64 verify_constant ../../gcc-source-trunk/gcc/cp/constexpr.c:1809 0x71267b cxx_eval_trinary_expression ../../gcc-source-trunk/gcc/cp/constexpr.c:3378 0x71267b cxx_eval_constant_expression ../../gcc-source-trunk/gcc/cp/constexpr.c:4526 0x71954d cxx_eval_outermost_constant_expr ../../gcc-source-trunk/gcc/cp/constexpr.c:4801 0x92a5a2 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ../../gcc-source-trunk/gcc/cp/typeck2.c:833 0x750492 check_initializer ../../gcc-source-trunk/gcc/cp/decl.c:6378 0x778871 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ../../gcc-source-trunk/gcc/cp/decl.c:7032 0x83428d cp_parser_init_declarator ../../gcc-source-trunk/gcc/cp/parser.c:19705 0x835f1f cp_parser_simple_declaration ../../gcc-source-trunk/gcc/cp/parser.c:13046 0x836e68 cp_parser_block_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12864 0x842c84 cp_parser_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12761 0x841606 cp_parser_declaration_seq_opt ../../gcc-source-trunk/gcc/cp/parser.c:12637 0x841923 cp_parser_translation_unit ../../gcc-source-trunk/gcc/cp/parser.c:4559 0x841923 c_parse_file() ../../gcc-source-trunk/gcc/cp/parser.c:38860 0x98a825 c_common_parse_file() ../../gcc-source-trunk/gcc/c-family/c-opts.c:1132 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. $ ------------------------------------------------------------------ typedef int vec __attribute__ ((vector_size (2 * sizeof (int)))); constexpr vec u = { 1, 2 }; constexpr vec v = __builtin_shuffle (v, u);