[Bug tree-optimization/41735] New: [4.5 Regression] inlined comdat function sometimes is emitted

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

[Bug tree-optimization/41735] New: [4.5 Regression] inlined comdat function sometimes is emitted

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

Reply to Author | View Threaded | Show Only this Message

Take:
struct g
{
inline g(void);
int t;
};

inline g::g(void)
{
 t = 0;
}


int h(void)
{
  g a;
  return a.t;
}

--- CUT ---
g::g() is being emitted even at -O2 -fno-early-inlining even though it has been
inlined.

Note we either update the cgraph after early inlining or it updates it
correctly.


--
           Summary: [4.5 Regression] inlined comdat function sometimes is
                    emitted
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


[Bug tree-optimization/41735] [4.5 Regression] inlined comdat function sometimes is emitted

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

Reply to Author | View Threaded | Show Only this Message



--

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.5.0
      Known to work|                            |4.4.1
   Target Milestone|---                         |4.5.0


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


[Bug tree-optimization/41735] [4.5 Regression] inlined comdat function sometimes is emitted

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

Reply to Author | View Threaded | Show Only this Message



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-10-17 00:21 -------
Oh if I did not have t = 0; there, the function would have been eliminated too
as const/pure is able to figure out that function is constant and able to
remove it and something comes along and updates the cgraph.


--


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


[Bug tree-optimization/41735] [4.5 Regression] inlined comdat function sometimes is emitted

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

Reply to Author | View Threaded | Show Only this Message



------- Comment #2 from rguenth at gcc dot gnu dot org  2009-10-24 11:59 -------
Confirmed.


--

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Priority|P3                          |P1
   Last reconfirmed|0000-00-00 00:00:00         |2009-10-24 11:59:05
               date|                            |


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


[Bug tree-optimization/41735] [4.5 Regression] inlined comdat function sometimes is emitted

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

Reply to Author | View Threaded | Show Only this Message



------- Comment #3 from hubicka at gcc dot gnu dot org  2009-11-11 22:23 -------
Testing patch.


--

hubicka at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |hubicka at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-10-24 11:59:05         |2009-11-11 22:23:40
               date|                            |


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


[Bug tree-optimization/41735] [4.5 Regression] inlined comdat function sometimes is emitted

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

Reply to Author | View Threaded | Show Only this Message



------- Comment #4 from hubicka at gcc dot gnu dot org  2009-11-11 23:45 -------
Subject: Bug 41735

Author: hubicka
Date: Wed Nov 11 23:45:09 2009
New Revision: 154108

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154108
Log:

        PR middle-end/41729
        * ipa.c (function_and_variable_visibility): Do not privatize COMDAT
        and WEAK variables at -fwhole-program.

        PR middle-end/41735
        * ipa.c (whole_program_function_and_variable_visility): COMDAT
        functions/variables are not needed even if they are externally visible.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa.c


--


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


[Bug tree-optimization/41735] [4.5 Regression] inlined comdat function sometimes is emitted

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

Reply to Author | View Threaded | Show Only this Message



------- Comment #5 from hubicka at gcc dot gnu dot org  2009-11-12 12:37 -------
Fixed by my patch.


--

hubicka at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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