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

            Bug ID: 120018
           Summary: internal compiler error: in redirect_to_unreachable,
                    at ipa-fnsummary.cc:258 for 32-bits
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dkm at gcc dot gnu.org
  Target Milestone: ---

Running the rust testsuite with -m32 on x86_64 triggers 2 ICE:

 /.../git/gcc-master/build/gcc/testsuite/rust10/../../gccrs
-B.../git/gcc-master/build/gcc/testsuite/rust10/../../
/.../git/gcc-master/gcc/testsuite/rust/execute/torture/derive_clone_enum1.rs
-m32 -fdiagnostics-plain-output
-frust-incomplete-and-experimental-compiler-do-not-use -O1 -lm -o
./derive_clone_enum1.exe
during IPA pass: inline
crab1: internal compiler error: in redirect_to_unreachable, at
ipa-fnsummary.cc:258
0x38f10b1 internal_error(char const*, ...)
    ../../gcc/diagnostic-global-context.cc:517
0x38d9cff fancy_abort(char const*, int, char const*)
    ../../gcc/diagnostic.cc:1748
0x2c61577 redirect_to_unreachable
    ../../gcc/ipa-fnsummary.cc:258
0x2c61577 edge_set_predicate
    ../../gcc/ipa-fnsummary.cc:290
0x2c52390 remap_edge_summaries
    ../../gcc/ipa-fnsummary.cc:4355
0x2c55bdf ipa_merge_fn_summary_after_inlining(cgraph_edge*)
    ../../gcc/ipa-fnsummary.cc:4519
0x2c9942f inline_call(cgraph_edge*, bool, vec<cgraph_edge*, va_heap, vl_ptr>*,
int*, bool, bool*)
    ../../gcc/ipa-inline-transform.cc:522
0x2c80250 inline_to_all_callers_1
    ../../gcc/ipa-inline.cc:2612
0x2c80250 inline_to_all_callers
    ../../gcc/ipa-inline.cc:2637
0x2c81e1a cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*,
void*), void*, bool)
    ../../gcc/cgraph.h:3434
0x2c81e1a ipa_inline
    ../../gcc/ipa-inline.cc:2962
0x2c81e1a execute
    ../../gcc/ipa-inline.cc:3291

Failing assert is:
 258   │   gcc_checking_assert (lookup_attribute ("cold",
 259   │                      DECL_ATTRIBUTES (target->decl)));

(gdb) call debug_tree(target->decl)
 <function_decl 0x7ffff72db700 __builtin_unreachable
    type <function_type 0x7ffff722a0a8
        type <void_type 0x7ffff72240a8 VOID
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff72240a8
            pointer_to_this <pointer_type 0x7ffff7224150>>
        QI
        size <integer_cst 0x7ffff7202f00 constant 8>
        unit-size <integer_cst 0x7ffff7202f18 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff722a0a8
        arg-types <tree_list 0x7ffff721bcd0 value <void_type 0x7ffff72240a8>>
        pointer_to_this <pointer_type 0x7ffff726c7e0>>
    public external built-in QI <built-in>:0:0
    align:8 warn_if_not_align:0 built-in: BUILT_IN_NORMAL:BUILT_IN_UNREACHABLE>

Or maybe the rust frontend is doing something incorrect with
__builtin_unreachable?

Reply via email to