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

            Bug ID: 119264
           Summary: ICE: tree check: expected class 'type', have
                    'exceptional' (error_mark) in tree_nonzero_bits, at
                    fold-const.cc:16688
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bic60176 at gmail dot com
  Target Milestone: ---

Created attachment 60737
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60737&action=edit
testcase

Compiler Explorer: https://godbolt.org/z/W36Konoq5

Console:
<source>:8:5: error: 'f' redeclared as different kind of symbol
    8 | int f() {
      |     ^
<source>:2:13: note: previous declaration of 'f' with type 'signed char'
    2 | signed char f;
      |             ^
<source>: In function 'h':
<source>:6:9: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in tree_nonzero_bits, at fold-const.cc:16688
    6 |     d = !(f & ~2880764155);
      |         ^~~~~~~~~~~~~~~~~~
0x25f3205 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x260a226 internal_error(char const*, ...)
        ???:0
0x8f3e3f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ???:0
0xd2bf5a tree_nonzero_bits(tree_node const*)
        ???:0
0x1a34311 tree_zero_one_valued_p(tree_node*)
        ???:0
0x1a4dfc1 generic_simplify_CONVERT_EXPR(unsigned long, tree_code, tree_node*,
tree_node*)
        ???:0
0xd3c43b fold_unary_loc(unsigned long, tree_code, tree_node*, tree_node*)
        ???:0
0xd3ec6d fold_build1_loc(unsigned long, tree_code, tree_node*, tree_node*)
        ???:0
0xdecd14 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xde9852 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xded1ba gimplify_stmt(tree_node**, gimple**)
        ???:0
0xdea6ab gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xded1ba gimplify_stmt(tree_node**, gimple**)
        ???:0
0xdeaffc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xdf3536 gimplify_body(tree_node*, bool)
        ???:0
0xdf39fc gimplify_function_tree(tree_node*)
        ???:0
0xc06e87 cgraph_node::analyze()
        ???:0
0xc0a1b1 symbol_table::finalize_compilation_unit()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

Reply via email to