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

            Bug ID: 95466
           Summary: [11 Regression] ICE in tree_operand_check, at
                    tree.h:3794 since r11-578-g72af65b91cc2a2eb
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jason at gcc dot gnu.org
  Target Milestone: ---

Since the revision I see:

$ cat multi.ii
class A {
  virtual void m_fn1();
};
class C {
public:
  virtual void m_fn2();
};
class B : A, public C {};
main() {
  B b;
  static_cast<C *>(&b)->m_fn2();
}

$ g++ multi.ii -c -fsanitize=vptr
multi.ii:9:1: warning: ISO C++ forbids declaration of ‘main’ with no type
[-Wreturn-type]
    9 | main() {
      | ^~~~
multi.ii: In function ‘int main()’:
multi.ii:12:1: internal compiler error: tree check: expected class
‘expression’, have ‘declaration’ (var_decl) in tree_operand_check, at
tree.h:3794
   12 | }
      | ^
0x848dc6 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.c:9756
0x641b85 expr_check(tree_node*, char const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.h:3465
0x641b85 tree_operand_check(tree_node*, int, char const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.h:3794
0x641b85 cp_ubsan_maybe_instrument_member_call(tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/cp-ubsan.c:136
0x9a5f93 cp_genericize_r
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1775
0x138abf3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.c:11978
0x9a66ca cp_genericize_r
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1847
0x138abf3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.c:11978
0x9a78b2 cp_genericize_r
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1456
0x138abf3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.c:11978
0x9a66ca cp_genericize_r
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1847
0x138abf3 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.c:11978
0x9a4de8 cp_genericize_tree
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1882
0x9a5074 cp_genericize(tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:2031
0x9e6d61 finish_function(bool)
        /home/marxin/Programming/gcc/gcc/cp/decl.c:17201
0xa92eaa cp_parser_function_definition_after_declarator
        /home/marxin/Programming/gcc/gcc/cp/parser.c:29024
0xa93c81 cp_parser_function_definition_from_specifiers_and_declarator
        /home/marxin/Programming/gcc/gcc/cp/parser.c:28937
0xa93c81 cp_parser_init_declarator
        /home/marxin/Programming/gcc/gcc/cp/parser.c:20685
0xa72ea3 cp_parser_simple_declaration
        /home/marxin/Programming/gcc/gcc/cp/parser.c:13749
0xa9bbc7 cp_parser_declaration
        /home/marxin/Programming/gcc/gcc/cp/parser.c:13448
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.

Reply via email to