https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83060
Bug ID: 83060 Summary: ICE on valid C++ code: in ignore_overflows, at cp/cvt.c:583 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: --- It affects at least all versions as early as 4.8.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 20171119 (experimental) [trunk revision 254940] (GCC) $ $ clang++ -c tmp.cpp $ icc -c tmp.cpp $ $ g++tk -c tmp.cpp tmp.cpp:7:37: internal compiler error: in ignore_overflows, at cp/cvt.c:583 int b = __builtin_offsetof (A, s[-1]); ^ 0x72ac8d ignore_overflows ../../gcc-source-trunk/gcc/cp/cvt.c:583 0x72d428 ocp_convert(tree_node*, tree_node*, int, int, int) ../../gcc-source-trunk/gcc/cp/cvt.c:817 0x80ef06 cp_parser_builtin_offsetof ../../gcc-source-trunk/gcc/cp/parser.c:9930 0x80ef06 cp_parser_primary_expression ../../gcc-source-trunk/gcc/cp/parser.c:5335 0x8103dd cp_parser_postfix_expression ../../gcc-source-trunk/gcc/cp/parser.c:7022 0x82b97c cp_parser_unary_expression ../../gcc-source-trunk/gcc/cp/parser.c:8363 0x7fafcc cp_parser_cast_expression ../../gcc-source-trunk/gcc/cp/parser.c:9131 0x7fb733 cp_parser_binary_expression ../../gcc-source-trunk/gcc/cp/parser.c:9232 0x7fc020 cp_parser_assignment_expression ../../gcc-source-trunk/gcc/cp/parser.c:9519 0x7fd0f3 cp_parser_constant_expression ../../gcc-source-trunk/gcc/cp/parser.c:9803 0x7fd9c7 cp_parser_initializer_clause ../../gcc-source-trunk/gcc/cp/parser.c:21978 0x8007d3 cp_parser_initializer ../../gcc-source-trunk/gcc/cp/parser.c:21918 0x8268a6 cp_parser_init_declarator ../../gcc-source-trunk/gcc/cp/parser.c:19716 0x82949f cp_parser_simple_declaration ../../gcc-source-trunk/gcc/cp/parser.c:13125 0x82a338 cp_parser_block_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12943 0x832674 cp_parser_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12840 0x831016 cp_parser_declaration_seq_opt ../../gcc-source-trunk/gcc/cp/parser.c:12716 0x83133e cp_parser_translation_unit ../../gcc-source-trunk/gcc/cp/parser.c:4502 0x83133e c_parse_file() ../../gcc-source-trunk/gcc/cp/parser.c:39022 0x977ee5 c_common_parse_file() ../../gcc-source-trunk/gcc/c-family/c-opts.c:1127 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. $ ---------------------------------- struct A { int i; int s[8]; }; int b = __builtin_offsetof (A, s[-1]);