https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83659
Bug ID: 83659 Summary: ICE on compilable C++ code: in tree_to_shwi, at tree.c:6821 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 affects 7.x and the current trunk, and is a regression from 6.4.x. $ 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.0/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.0 20180102 (experimental) [trunk revision 256110] (GCC) $ $ g++-6.4.0 small.cpp $ icc small.cpp $ clang++ small.cpp $ $ g++tk small.cpp small.cpp: In function ‘int main()’: small.cpp:7:42: internal compiler error: in tree_to_shwi, at tree.c:6821 reinterpret_cast < int * > (&a)[-1] += 1; ^ 0x11559a2 tree_to_shwi(tree_node const*) ../../gcc-source-trunk/gcc/tree.c:6821 0x703bd7 cxx_fold_indirect_ref ../../gcc-source-trunk/gcc/cp/constexpr.c:3112 0x70bc4b cxx_eval_indirect_ref ../../gcc-source-trunk/gcc/cp/constexpr.c:3215 0x70bc4b cxx_eval_constant_expression ../../gcc-source-trunk/gcc/cp/constexpr.c:4271 0x7126ed cxx_eval_outermost_constant_expr ../../gcc-source-trunk/gcc/cp/constexpr.c:4769 0x715c06 maybe_constant_value(tree_node*, tree_node*) ../../gcc-source-trunk/gcc/cp/constexpr.c:4983 0x729de1 cp_fully_fold(tree_node*) ../../gcc-source-trunk/gcc/cp/cp-gimplify.c:2033 0x90b967 cp_build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, int) ../../gcc-source-trunk/gcc/cp/typeck.c:5381 0x919111 cp_build_modify_expr(unsigned int, tree_node*, tree_code, tree_node*, int) ../../gcc-source-trunk/gcc/cp/typeck.c:8067 0x6d66ea build_new_op_1 ../../gcc-source-trunk/gcc/cp/call.c:5963 0x6d6fce build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*, tree_node*, tree_node**, int) ../../gcc-source-trunk/gcc/cp/call.c:6047 0x91b133 build_x_modify_expr(unsigned int, tree_node*, tree_code, tree_node*, int) ../../gcc-source-trunk/gcc/cp/typeck.c:8263 0x8042a6 cp_parser_assignment_expression ../../gcc-source-trunk/gcc/cp/parser.c:9458 0x80499a cp_parser_expression ../../gcc-source-trunk/gcc/cp/parser.c:9586 0x808179 cp_parser_expression_statement ../../gcc-source-trunk/gcc/cp/parser.c:11042 0x81185c cp_parser_statement ../../gcc-source-trunk/gcc/cp/parser.c:10858 0x812a1f cp_parser_statement_seq_opt ../../gcc-source-trunk/gcc/cp/parser.c:11185 0x812b2f cp_parser_compound_statement ../../gcc-source-trunk/gcc/cp/parser.c:11139 0x827f40 cp_parser_function_body ../../gcc-source-trunk/gcc/cp/parser.c:21681 0x827f40 cp_parser_ctor_initializer_opt_and_function_body ../../gcc-source-trunk/gcc/cp/parser.c:21716 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 V __attribute__ ((__vector_size__ (16))); V a; int main () { reinterpret_cast < int * > (&a)[-1] += 1; return 0; }