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

            Bug ID: 70205
           Summary: ICE on valid code on x86_64-linux-gnu: tree check:
                    expected tree_binfo, have error_mark in
                    add_candidates, at cp/call.c:5283
           Product: gcc
           Version: 6.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 valid 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 5.3.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/6.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 6.0.0 20160311 (experimental) [trunk revision 234134] (GCC) 
$ 
$ g++-5.3 -c small.cpp
$ 
$ g++-trunk -c small.cpp
small.cpp: In member function ‘void D::g()’:
small.cpp:19:11: internal compiler error: tree check: expected tree_binfo, have
error_mark in add_candidates, at cp/call.c:5283
     D::f ();
           ^
0xfe10bc tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc-source-trunk/gcc/tree.c:9643
0x61c634 tree_check
        ../../gcc-source-trunk/gcc/tree.h:3006
0x61c634 add_candidates
        ../../gcc-source-trunk/gcc/cp/call.c:5283
0x61ccf6 build_new_method_call_1
        ../../gcc-source-trunk/gcc/cp/call.c:8284
0x61ccf6 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ../../gcc-source-trunk/gcc/cp/call.c:8480
0x7bbddc finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../gcc-source-trunk/gcc/cp/semantics.c:2410
0x735a49 cp_parser_postfix_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:6904
0x73edbc cp_parser_unary_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:7988
0x73f617 cp_parser_cast_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:8665
0x73fc15 cp_parser_binary_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:8767
0x740500 cp_parser_assignment_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9055
0x742dd9 cp_parser_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9222
0x74354f cp_parser_expression_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10683
0x73129b cp_parser_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10534
0x731f4c cp_parser_statement_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:10806
0x73203f cp_parser_compound_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10760
0x75087f cp_parser_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:20639
0x75087f cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:20675
0x751321 cp_parser_function_definition_after_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:25337
0x756750 cp_parser_late_parsing_for_member
        ../../gcc-source-trunk/gcc/cp/parser.c:26177
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.
$ 


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


class A
{
protected:
  static void f ();
};

class B : public A
{
};

class C : public A
{
};

class D : public C, public B
{
  void g ()
  {
    D::f ();
  }
};

Reply via email to