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

            Bug ID: 108593
           Summary: No inlining after function cloning
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: david.bolvansky at gmail dot com
  Target Milestone: ---

int __attribute__ ((noinline))
foo (int arg)
{
  return 2 * arg;
}

int
bar (int arg)
{
  return foo (5);
}


results in:
foo.constprop.0:
        mov     eax, 10
        ret
foo:
        lea     eax, [rdi+rdi]
        ret
bar:
        jmp     foo.constprop.0


But ... why foo.constprop.0 is not inlined fully into bar? Maybe
foo.constprop.0  inherits noinline attribute from foo? 

If so, gcc should drop attributes from cloned functions..
  • [Bug c/108593] New: No inlin... david.bolvansky at gmail dot com via Gcc-bugs

Reply via email to