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

            Bug ID: 118898
           Summary: ICE: tree check: expected class 'type', have
                    'exceptional' (error_mark) in
                    useless_type_conversion_p, at gimple-expr.cc:85
           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 60513
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60513&action=edit
testcase

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

console:
<source>:9:7: error: 'f' redeclared as different kind of symbol
    9 | float f(int b, int x) {
      |       ^
<source>:1:5: note: previous declaration of 'f' with type 'int'
    1 | int f;
      |     ^
<source>: In function 'foo':
<source>:7:10: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85
    7 |   return *(unsigned int *)&f;
      |          ^~~~~~~~~~~~~~~~~~~
0x25f34a5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x260a576 internal_error(char const*, ...)
        ???:0
0x8f3d53 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ???:0
0xd95b18 gimple_fold_indirect_ref(tree_node*)
        ???:0
0xde6132 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xde9aba gimplify_stmt(tree_node**, gimple**)
        ???:0
0xde7ec2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xde9aba gimplify_stmt(tree_node**, gimple**)
        ???:0
0xde6f8b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xde9aba gimplify_stmt(tree_node**, gimple**)
        ???:0
0xde78dc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xdefe16 gimplify_body(tree_node*, bool)
        ???:0
0xdf02dc gimplify_function_tree(tree_node*)
        ???:0
0xc051b7 cgraph_node::analyze()
        ???:0
0xc08531 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