public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108593] New: No inlining after function cloning
@ 2023-01-29 19:16 david.bolvansky at gmail dot com
  2023-01-29 20:19 ` [Bug ipa/108593] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: david.bolvansky at gmail dot com @ 2023-01-29 19:16 UTC (permalink / raw)
  To: gcc-bugs

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..

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug ipa/108593] No inlining after function cloning
  2023-01-29 19:16 [Bug c/108593] New: No inlining after function cloning david.bolvansky at gmail dot com
@ 2023-01-29 20:19 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-29 20:19 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is by design.
That is a function clone will inherits most of the attributes from its parent.
There are a few will not be inherited in the case of function arguments change;
e.g. nonnull .

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-29 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-29 19:16 [Bug c/108593] New: No inlining after function cloning david.bolvansky at gmail dot com
2023-01-29 20:19 ` [Bug ipa/108593] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).