https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71828
Bug ID: 71828 Summary: ICE on valid C++11 code with __Complex int variable declaration: in operand_equal_p, at fold-const.c:2790 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- The following C++11 code causes an ICE when compiled with the current GCC trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes. This is a regression from 6.1.x. $ g++-trunk -v Using built-in specs. COLLECT_GCC=g++-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20160709 (experimental) [trunk revision 238191] (GCC) $ $ g++-6.1 -c small.cpp $ $ g++-trunk -c small.cpp small.cpp:3:44: internal compiler error: in operand_equal_p, at fold-const.c:2790 static_assert (& __imag a == &__real a, ""); ^ 0xab89b0 operand_equal_p(tree_node const*, tree_node const*, unsigned int) ../../gcc-source-trunk/gcc/fold-const.c:2790 0xab70e9 operand_equal_p(tree_node const*, tree_node const*, unsigned int) ../../gcc-source-trunk/gcc/fold-const.c:2951 0xab6cbf operand_equal_p(tree_node const*, tree_node const*, unsigned int) ../../gcc-source-trunk/gcc/fold-const.c:2749 0x1226391 generic_simplify_EQ_EXPR /tmp/gcc-builder/gcc-build-trunk/gcc/generic-match.c:27436 0x122ab55 generic_simplify(unsigned int, tree_code, tree_node*, tree_node*, tree_node*) /tmp/gcc-builder/gcc-build-trunk/gcc/generic-match.c:31021 0xac73f7 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*, tree_node*) ../../gcc-source-trunk/gcc/fold-const.c:9161 0x8aeba8 cxx_eval_binary_expression ../../gcc-source-trunk/gcc/cp/constexpr.c:1816 0x8ab4d7 cxx_eval_constant_expression ../../gcc-source-trunk/gcc/cp/constexpr.c:3885 0x8b1ec9 cxx_eval_outermost_constant_expr ../../gcc-source-trunk/gcc/cp/constexpr.c:4211 0x8b4ec8 maybe_constant_value_1 ../../gcc-source-trunk/gcc/cp/constexpr.c:4405 0x8b4ec8 maybe_constant_value(tree_node*, tree_node*) ../../gcc-source-trunk/gcc/cp/constexpr.c:4429 0x81ded5 finish_static_assert(tree_node*, tree_node*, unsigned int, bool) ../../gcc-source-trunk/gcc/cp/semantics.c:8749 0x79c370 cp_parser_static_assert ../../gcc-source-trunk/gcc/cp/parser.c:13056 0x7ae489 cp_parser_block_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12247 0x7b6d50 cp_parser_declaration ../../gcc-source-trunk/gcc/cp/parser.c:12148 0x7b5824 cp_parser_declaration_seq_opt ../../gcc-source-trunk/gcc/cp/parser.c:12027 0x7b5b58 cp_parser_translation_unit ../../gcc-source-trunk/gcc/cp/parser.c:4329 0x7b5b58 c_parse_file() ../../gcc-source-trunk/gcc/cp/parser.c:37505 0x919dc2 c_common_parse_file() ../../gcc-source-trunk/gcc/c-family/c-opts.c:1070 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. $ ------------------------------------------------- constexpr _Complex int a {1, 1}; static_assert (& __imag a == &__real a, "");