public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/26850]  New: unused function not eliminated with -fwhole-program --combine
@ 2006-03-24 16:24 dann at godzilla dot ics dot uci dot edu
  2006-03-24 16:27 ` [Bug tree-optimization/26850] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2006-03-24 16:24 UTC (permalink / raw)
  To: gcc-bugs

Compile these 2 files with gcc -O2 -fwhole-program --combine a.c b.c 
a.c: 
int main (void) {  return 0;}

b.c:
static int tst1 (int x) {return x;}
static int global_static;
int global;
int tst2 (int x,  int y) {foo (tst1, x, y, &global_static, &global);}


The generated assembly still contains the tst1 function. tst2, global and
static_global have been eliminated. 

It seems that functions that have their address taken should be reconsidered
for elimination after eliminating the functions (and variables too) that took
their address. 

Note that in the above case compiling the files separately will generate less
code as the whole b.o file will be eliminated by the linker...


-- 
           Summary: unused function not eliminated with -fwhole-program --
                    combine
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug tree-optimization/26850] unused function not eliminated with -fwhole-program --combine
  2006-03-24 16:24 [Bug tree-optimization/26850] New: unused function not eliminated with -fwhole-program --combine dann at godzilla dot ics dot uci dot edu
@ 2006-03-24 16:27 ` pinskia at gcc dot gnu dot org
  2006-03-26 17:16 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-24 16:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-24 16:27 -------
IIRC the problem here is that we don't go through the program again to change
TREE_ADDRESSABLE on those decls.


-- 


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


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

* [Bug tree-optimization/26850] unused function not eliminated with -fwhole-program --combine
  2006-03-24 16:24 [Bug tree-optimization/26850] New: unused function not eliminated with -fwhole-program --combine dann at godzilla dot ics dot uci dot edu
  2006-03-24 16:27 ` [Bug tree-optimization/26850] " pinskia at gcc dot gnu dot org
@ 2006-03-26 17:16 ` pinskia at gcc dot gnu dot org
  2008-11-25 20:02 ` alexandre dot nunes at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-26 17:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-03-26 17:16 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
 GCC target triplet|i686-pc-linux-gnu           |
   Last reconfirmed|0000-00-00 00:00:00         |2006-03-26 17:16:04
               date|                            |


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


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

* [Bug tree-optimization/26850] unused function not eliminated with -fwhole-program --combine
  2006-03-24 16:24 [Bug tree-optimization/26850] New: unused function not eliminated with -fwhole-program --combine dann at godzilla dot ics dot uci dot edu
  2006-03-24 16:27 ` [Bug tree-optimization/26850] " pinskia at gcc dot gnu dot org
  2006-03-26 17:16 ` pinskia at gcc dot gnu dot org
@ 2008-11-25 20:02 ` alexandre dot nunes at gmail dot com
  2010-09-17  9:08 ` rguenth at gcc dot gnu dot org
  2010-09-17 11:10 ` hubicka at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: alexandre dot nunes at gmail dot com @ 2008-11-25 20:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from alexandre dot nunes at gmail dot com  2008-11-25 20:01 -------
Still fails as of gcc 4.3.2


-- 


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


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

* [Bug tree-optimization/26850] unused function not eliminated with -fwhole-program --combine
  2006-03-24 16:24 [Bug tree-optimization/26850] New: unused function not eliminated with -fwhole-program --combine dann at godzilla dot ics dot uci dot edu
                   ` (2 preceding siblings ...)
  2008-11-25 20:02 ` alexandre dot nunes at gmail dot com
@ 2010-09-17  9:08 ` rguenth at gcc dot gnu dot org
  2010-09-17 11:10 ` hubicka at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-17  9:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2010-09-17 09:06 -------
-combine has been removed from GCC 4.6 in favor of LTO, closing as WONTFIX.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug tree-optimization/26850] unused function not eliminated with -fwhole-program --combine
  2006-03-24 16:24 [Bug tree-optimization/26850] New: unused function not eliminated with -fwhole-program --combine dann at godzilla dot ics dot uci dot edu
                   ` (3 preceding siblings ...)
  2010-09-17  9:08 ` rguenth at gcc dot gnu dot org
@ 2010-09-17 11:10 ` hubicka at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2010-09-17 11:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hubicka at gcc dot gnu dot org  2010-09-17 11:09 -------
Well, this is still something we should solve at LTO.  Indirect inlining should
take away references that are fully resolved so function becomes unreachable.

Honza


-- 


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


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

end of thread, other threads:[~2010-09-17 11:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-24 16:24 [Bug tree-optimization/26850] New: unused function not eliminated with -fwhole-program --combine dann at godzilla dot ics dot uci dot edu
2006-03-24 16:27 ` [Bug tree-optimization/26850] " pinskia at gcc dot gnu dot org
2006-03-26 17:16 ` pinskia at gcc dot gnu dot org
2008-11-25 20:02 ` alexandre dot nunes at gmail dot com
2010-09-17  9:08 ` rguenth at gcc dot gnu dot org
2010-09-17 11:10 ` hubicka at gcc dot gnu dot org

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