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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
For GCC "leaf" is interpreted at the LTO WPA stage where 'compilation unit'
then
means the whole program.  Note that "leaf" doesn't mean calls "back" into the
CU that GCC _can see_ are invalid - those are treated correctly.  It's
basically an optimization promise that if GCC doesn't see such call it can
assume there
are no "hidden" ones.

If GCC, with LTO, would partition the program into two LTRANS partitions,
one containing main and bar and one containing foo then applying this
optimization promise during LTRANS time on the main/bar partition would
be wrong as you say - but I think GCC doesn't do this.

As for documentation I think 'compilation unit' should be changed to
'translation unit', since that's the only thing a user can reason about.
The compiler then has to make sure to apply compatible reasoning when
combining multiple translation units.

Honza?

Reply via email to