This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ipa/64801] [5 Regression] kernel build failure due to ICF


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

--- Comment #1 from Martin LiÅka <marxin at gcc dot gnu.org> ---
You are right, the problem is hidden in cooperation between IPA inliner and
ICF.

If I run the test w/o ICF, inliner sets NULL to the fsp_detect FUNCTION_DECL:

#0  0x000000000074541e in symtab_node::unregister (this=0x7ffff6c47620) at
../../gcc/symtab.c:407
#1  0x000000000074b0ef in cgraph_node::remove (this=0x7ffff6c47620) at
../../gcc/cgraph.c:1741
#2  0x0000000000b891b9 in expand_call_inline (id=0x7fffffffd5c0,
stmt=0x7ffff6d54aa0, bb=<optimized out>)
    at ../../gcc/tree-inline.c:4762
#3  gimple_expand_calls_inline (id=0x7fffffffd5c0, bb=<optimized out>) at
../../gcc/tree-inline.c:4787

so that cgraph_node::get(decl) == NULL here:

    if (symtab->state != LTO_STREAMING) 
   â1784        {
B+>â1785          n = cgraph_node::get (decl);
   â1786          if (!n                      
   â1787              || (!n->clones && !n->clone_of && !n->global.inlined_to
   â1788                  && (symtab->global_info_ready      
   â1789                      && (TREE_ASM_WRITTEN (n->decl) 
   â1790                          || DECL_EXTERNAL (n->decl) 
   â1791                          || !n->analyzed            
   â1792                          || (!flag_wpa && n->in_other_partition)))))  
   â1793            release_body ();                         
   â1794        }                                                         

That's the reason why the body is not removed. On the contrary, with ICF,
aforementioned condition is satisfied and fsp_detect's body is removed.
I think the situation after IPA ICF is correct:

fsp_detect/2 (fsp_detect) @0x7ffff6c47620
  Type: function definition analyzed
  Visibility: external public
  References: 
  Referring: 
  Availability: available
  First run: 0
  Function flags: body
  Called by: elantech_detect/1 (1.00 per call) psmouse_extensions/3 (1.00 per
call) 
  Calls: 
elantech_detect/1 (elantech_detect) @0x7ffff6c47498
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Availability: available
  First run: 0
  Function flags: body icf_merged
  Called by: 
  Calls: fsp_detect/2 (1.00 per call) 

Can you please help me Honza?
Thanks,
Martin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]