public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/47247] New: Linker plugin specification makes it difficult to handle COMDATs
@ 2011-01-10 16:51 hubicka at gcc dot gnu.org
  2011-01-10 17:02 ` [Bug lto/47247] " hubicka at gcc dot gnu.org
                   ` (33 more replies)
  0 siblings, 34 replies; 36+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-10 16:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47247

           Summary: Linker plugin specification makes it difficult to
                    handle COMDATs
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hubicka@gcc.gnu.org


Current linker plugin specification has problem with COMDAT.  When COMDAT
fnuction is put into symbol table and is used, it gets resolved as PREVAILING.
This imply that it must be output in the final binary.

This is often suboptimal because inlining often eliminate need for the out of
line copy of COMDAT. GCC works around by not putting COMDAT symbols into symbol
table. This leads to posibility that both LTO and non-LTO objects will define
variant of the COMDAT function and that GCC will bring the LTO one static and
thus two copies of COMDAT will be present. For this reason GCC will not do this
for COMDAT function that is not virtual and has address taken.

This trick works well in most cases, but leads i.e. to undefined symbols when
Mozilla is built with LTO and -fprofile-generate
https://bugzilla.mozilla.org/show_bug.cgi?id=624385

this is because GCC no longer optimize out some functions from unused header.
This is because indirect call profiling takes their address and forces them to
stay in the program.

In longer therm we really need better solution for this.


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

end of thread, other threads:[~2012-05-14  7:42 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-10 16:51 [Bug lto/47247] New: Linker plugin specification makes it difficult to handle COMDATs hubicka at gcc dot gnu.org
2011-01-10 17:02 ` [Bug lto/47247] " hubicka at gcc dot gnu.org
2011-01-10 17:11 ` hjl.tools at gmail dot com
2011-01-10 17:12 ` hjl.tools at gmail dot com
2011-01-10 17:13 ` hubicka at ucw dot cz
2011-01-10 17:19 ` hjl.tools at gmail dot com
2011-01-10 18:20 ` hubicka at gcc dot gnu.org
2011-01-10 18:36 ` hjl.tools at gmail dot com
2011-01-10 19:06 ` ccoutant at gcc dot gnu.org
2011-01-10 19:08 ` ccoutant at gcc dot gnu.org
2011-01-10 21:27 ` hubicka at gcc dot gnu.org
2011-01-10 21:27 ` hjl.tools at gmail dot com
2011-02-14 20:34 ` rafael.espindola at gmail dot com
2011-02-15 18:51 ` hubicka at ucw dot cz
2011-02-15 19:45 ` rafael.espindola at gmail dot com
2011-02-16  0:23 ` hubicka at ucw dot cz
2011-02-16  4:04 ` rafael.espindola at gmail dot com
2011-02-16  7:59 ` hubicka at ucw dot cz
2011-02-16 16:23 ` rafael.espindola at gmail dot com
2011-02-16 23:13   ` Jan Hubicka
2011-02-16 23:18 ` hubicka at ucw dot cz
2011-02-16 23:37 ` ccoutant at google dot com
2011-02-17  1:25 ` rafael.espindola at gmail dot com
2011-08-27 18:16 ` hubicka at gcc dot gnu.org
2011-09-26 21:47 ` ccoutant at gcc dot gnu.org
2011-09-27  0:23 ` ccoutant at gcc dot gnu.org
2011-09-28 13:09 ` hubicka at gcc dot gnu.org
2011-10-02 10:42 ` hubicka at gcc dot gnu.org
2012-05-10  7:32 ` vincenzo.innocente at cern dot ch
2012-05-10  7:54 ` rguenth at gcc dot gnu.org
2012-05-10  8:52 ` vincenzo.innocente at cern dot ch
2012-05-10 16:06 ` vincenzo.innocente at cern dot ch
2012-05-10 17:10 ` hubicka at ucw dot cz
2012-05-10 17:17 ` vincenzo.innocente at cern dot ch
2012-05-12 14:37 ` hubicka at gcc dot gnu.org
2012-05-14  8:13 ` vincenzo.innocente at cern dot ch

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