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

            Bug ID: 103636
           Summary: Clang build fails with -flto -fno-strict-aliaisng
                    -flifetime-dse=1 -fprofile-generate
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Buid fails with:
during IPA pass: inline
lto1: internal compiler error: Segmentation fault
0x9ed401 crash_signal
        ../../gcc/toplev.c:322
0x4ec993 can_inline_edge_p
        ../../gcc/ipa-inline.c:409
0x12f3be4 inline_small_functions
        ../../gcc/ipa-inline.c:2036
0x12f3be4 ipa_inline
        ../../gcc/ipa-inline.c:2743
0x12f3be4 execute
        ../../gcc/ipa-inline.c:3142

the failure is:
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  399)   else if
(profile_arc_flag
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  400)       &&
(lookup_attribute ("no_profile_instrument_function",
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  401)           
                 DECL_ATTRIBUTES (caller->decl)) == NULL_TREE)
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  402)       !=
(lookup_attribute ("no_profile_instrument_function",
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  403)           
                 DECL_ATTRIBUTES (callee->decl)) == NULL_TREE))
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  404)     {
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  405)      
cgraph_node *origin = caller;
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  406)      
while (origin->clone_of)
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  407)    origin
= origin->clone_of;
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  408)
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  409)       if
(!DECL_STRUCT_FUNCTION (origin->decl)->always_inline_functions_inlined)
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  410)    {
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  411)     
e->inline_failed = CIF_UNSPECIFIED;
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  412)     
inlinable = false;
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  413)    }
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  414)     }
aad72d2ea837 (Martin Liska           2021-06-22 10:09:01 +0200  415)
9a4841a37014 (Jan Hubicka            2018-01-30 14:23:39 +0100  416)   if
(!inlinable && report)
9a4841a37014 (Jan Hubicka            2018-01-30 14:23:39 +0100  417)    
report_inline_failed_reason (e);
9a4841a37014 (Jan Hubicka            2018-01-30 14:23:39 +0100  418)   return
inlinable;

one can not access DECL_STRUCT_FUNCTION in WPA.   g:aad72d2ea837 speaks about
einline, so why it is not tested in can_early_inline_edge_p?

Reply via email to