[Bug c++/37352] New: thunks for virtual function should work on lto

View: New views
12 Messages — Rating Filter:   Alert me  

[Bug c++/37352] New: thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00349.html:

   Currently the thunks for a function are
   emitted from the frontend, exactly when the function itself is emitted
   (as RTL).  The frontend does some analysis of thunks beforehand
   already, but I simply deactivated emission of thunks for my experiment.
   This needs to be done before IPA, either by making thunks a middle-end
   concept, or implementing alternate entry points for real

Maybe it is possible to generate thunks eagerly as a first solution?


--
           Summary: thunks for virtual function should work on lto
           Product: gcc
           Version: lto
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: espindola at google dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #1 from espindola at google dot com  2008-11-19 17:47 -------
Created an attachment (id=16722)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16722&action=view)
testcase


--


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #2 from espindola at google dot com  2008-11-19 17:49 -------
To reproduce:
g++ -O2 -c thunk.C -flto-single -o thunk-lto.o
g++ -O2 -c thunk.C -o thunk.o

readelf -s thunk.o  | grep Th
    35: 0000000000000000     6 FUNC    WEAK   DEFAULT   19 _ZThn8_N1C1fEv
readelf -s thunk-lto.o  | grep Th
    26: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZThn8_N1C1fEv


--


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #3 from espindola at google dot com  2008-11-19 17:53 -------
This case can be easily fixed by setting targetm.asm_out.can_output_mi_thunk to
NULL. This will introduce a performance regression.

The only case that will be missing is varg functions.

The llvm equivalent bug is http://llvm.org/bugs/show_bug.cgi?id=2861.


--


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-12-31 19:26 -------
Confirmed.


--

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-12-31 19:26:06
               date|                            |


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #5 from dnovillo at gcc dot gnu dot org  2008-12-31 19:32 -------

Initial fix at http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00953.html
Keeping open as thunks with varargs are still broken.


--

dnovillo at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|maddox at google dot com    |
         AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-12-31 19:26:06         |2008-12-31 19:32:54
               date|                            |


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #6 from rguenth at gcc dot gnu dot org  2009-10-06 13:53 -------
*** Bug 41602 has been marked as a duplicate of this bug. ***


--

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rubidium at openttd dot org


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #7 from rguenth at gcc dot gnu dot org  2009-10-06 13:54 -------
Another testcase in PR41602.  SPEC CPU 2006 450.soplex is the only one in
SPEC 2000/2006 to run into this issue.


--


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #8 from rguenth at gcc dot gnu dot org  2009-10-10 18:44 -------
*** Bug 41663 has been marked as a duplicate of this bug. ***


--

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |danglin at gcc dot gnu dot
                   |                            |org


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #9 from pinskia at gcc dot gnu dot org  2009-11-11 18:28 -------
*** Bug 42009 has been marked as a duplicate of this bug. ***


--

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamborm at gcc dot gnu dot
                   |                            |org


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #10 from rguenth at gcc dot gnu dot org  2009-11-11 20:32 -------
There's a simple workaround for most cases, condition asm-thunks on
!flag_write_lto.  We'll do this if a proper implementation doesn't come up
for 4.5.


--


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


[Bug c++/37352] thunks for virtual function should work on lto

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #11 from rguenth at gcc dot gnu dot org  2009-11-30 12:36 -------
Fixed by Honza.


--

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.5.0


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