https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106725
--- Comment #7 from Daniel Thornburgh ---
Correction: A compilation line was missed:
+$ gcc -flto -c -O2 main.c lto.c
$ gcc -c -O2 ext.c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106725
--- Comment #6 from Daniel Thornburgh ---
I spent a little more time on this, and here's a more concrete reproducer of
GCC's current behavior.
The setup again has 3 files: main.c, lto.c, and ext.c. lto.c is a simple
getter-setter interface wrap
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106725
--- Comment #4 from Daniel Thornburgh ---
(In reply to rguent...@suse.de from comment #3)
> As said, GCC shouldn't assume this since leaf is defined at translation
> unit level, not at LTO level.
Sure, but what prevents GCC from making this ass
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106725
--- Comment #2 from Daniel Thornburgh ---
(In reply to Richard Biener from comment #1)
> If GCC, with LTO, would partition the program into two LTRANS partitions,
> one containing main and bar and one containing foo then applying this
> optimiza
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106725
Bug ID: 106725
Summary: LTO semantics for __attribute__((leaf))
Product: gcc
Version: 12.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c