https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81575

            Bug ID: 81575
           Summary: ICE on C++ code: in cp_build_addr_expr_1, at
                    cp/typeck.c:5793
           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: ---

$ 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/8.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 8.0.0 20170726 (experimental) [trunk revision 250555] (GCC) 
$ 
$ icc -c -w small.cpp 
$ clang++ -c -w small.cpp
$ 
$ g++-trunk -c -w small.cpp
small.cpp: In function ‘void f()’:
small.cpp:6:8: internal compiler error: in cp_build_addr_expr_1, at
cp/typeck.c:5793
   c += a;
        ^
0x8f742e cp_build_addr_expr_1
        ../../gcc-source-trunk/gcc/cp/typeck.c:5793
0x8f892e cp_build_addr_expr(tree_node*, int)
        ../../gcc-source-trunk/gcc/cp/typeck.c:5892
0x8f892e decay_conversion(tree_node*, int, bool)
        ../../gcc-source-trunk/gcc/cp/typeck.c:2024
0x8fa8c6 cp_build_binary_op(unsigned int, tree_code, tree_node*, tree_node*,
int)
        ../../gcc-source-trunk/gcc/cp/typeck.c:4201
0x9085a3 cp_build_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
        ../../gcc-source-trunk/gcc/cp/typeck.c:7904
0x6be57c build_new_op_1
        ../../gcc-source-trunk/gcc/cp/call.c:5968
0x6bedfe build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
        ../../gcc-source-trunk/gcc/cp/call.c:6052
0x90a8a3 build_x_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
        ../../gcc-source-trunk/gcc/cp/typeck.c:8101
0x7f2126 cp_parser_assignment_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9352
0x7f4cea cp_parser_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9480
0x7f5349 cp_parser_expression_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:11048
0x8013bc cp_parser_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10864
0x80269f cp_parser_statement_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:11190
0x8027af cp_parser_compound_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:11144
0x81a9f0 cp_parser_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:21610
0x81a9f0 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:21646
0x81b511 cp_parser_function_definition_after_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:26467
0x81c30d cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:26379
0x81c30d cp_parser_init_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:19337
0x81c8a9 cp_parser_single_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:26931
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.
$ 


-----------------------------------


class {} const a[1];

template < class T > void f ()
{
  int c = 0;
  c += a;
}

Reply via email to