public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/47183] New: Please discard unused functions
@ 2011-01-05 17:48 d.g.gorbachev at gmail dot com
  2011-01-05 18:06 ` [Bug lto/47183] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-01-05 17:48 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Please discard unused functions
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: d.g.gorbachev@gmail.com


Created attachment 22908
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22908
Testcase

Compile it with `g++ -O2 -flto -fuse-linker-plugin 47183.C'.


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

* [Bug lto/47183] Please discard unused functions
  2011-01-05 17:48 [Bug lto/47183] New: Please discard unused functions d.g.gorbachev at gmail dot com
@ 2011-01-05 18:06 ` pinskia at gcc dot gnu.org
  2011-01-05 22:31 ` d.g.gorbachev at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-01-05 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-01-05 18:00:15 UTC ---
I don't see any unused functions here.


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

* [Bug lto/47183] Please discard unused functions
  2011-01-05 17:48 [Bug lto/47183] New: Please discard unused functions d.g.gorbachev at gmail dot com
  2011-01-05 18:06 ` [Bug lto/47183] " pinskia at gcc dot gnu.org
@ 2011-01-05 22:31 ` d.g.gorbachev at gmail dot com
  2011-01-05 23:38 ` hubicka at gcc dot gnu.org
  2011-01-06  3:17 ` hubicka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-01-05 22:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2011-01-05 22:13:55 UTC ---
It's operator delete(void*). Also, typeinfo for S, typeinfo name for S, vtable
for __cxxabiv1::__class_type_info are unused, too.


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

* [Bug lto/47183] Please discard unused functions
  2011-01-05 17:48 [Bug lto/47183] New: Please discard unused functions d.g.gorbachev at gmail dot com
  2011-01-05 18:06 ` [Bug lto/47183] " pinskia at gcc dot gnu.org
  2011-01-05 22:31 ` d.g.gorbachev at gmail dot com
@ 2011-01-05 23:38 ` hubicka at gcc dot gnu.org
  2011-01-06  3:17 ` hubicka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-05 23:38 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |hubicka at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-05 22:44:57 UTC ---
jh@evans:/abuild/jh/trunk-3/build-inst2/gcc> ./g++ -B ./ -O2 t.C -save-temps
-flto -fuse-linker-plugin
[Leaving LTRANS /abuild/jh/tmp//ccoul7Xo.args]
[Leaving LTRANS /abuild/jh/tmp//ccT1KSUO.ltrans.out]
[Leaving LTRANS /abuild/jh/tmp//ccOM6q7y.args]
[Leaving LTRANS /abuild/jh/tmp//ccT1KSUO.ltrans0.o]
jh@evans:/abuild/jh/trunk-3/build-inst2/gcc> cat *.s
        .file   "ccT1KSUO.ltrans0.o"
        .section        .text.startup,"ax",@progbits
        .p2align 4,,15
        .globl  main
        .type   main, @function
main:
.LFB0:
        .cfi_startproc
        xorl    %eax, %eax
        ret
        .cfi_endproc
.LFE0:
        .size   main, .-main
        .ident  "GCC: (GNU) 4.6.0 20110105 (experimental)"
        .section        .note.GNU-stack,"",@progbits


it is optimized out. 
With GNU LD I however get
jh@evans:/abuild/jh/trunk-3/build-inst2/gcc> nm a.out
0000000000600748 d _DYNAMIC
0000000000600910 d _GLOBAL_OFFSET_TABLE_
000000000040067c R _IO_stdin_used
                 w _Jv_RegisterClasses
0000000000400582 W _ZTI1S
0000000000400582 W _ZTS1S
                 U _ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3
                 U _ZdlPv@@GLIBCXX_3.4
0000000000600728 d __CTOR_END__
0000000000600720 d __CTOR_LIST__
0000000000600738 D __DTOR_END__
0000000000600730 d __DTOR_LIST__
0000000000400700 r __FRAME_END__
0000000000600740 d __JCR_END__
0000000000600740 d __JCR_LIST__
0000000000600940 A __bss_start
0000000000600930 D __data_start
0000000000400630 t __do_global_ctors_aux
00000000004004f0 t __do_global_dtors_aux
0000000000600938 D __dso_handle
                 w __gmon_start__
0000000000600720 d __init_array_end
0000000000600720 d __init_array_start
0000000000400590 T __libc_csu_fini
00000000004005a0 T __libc_csu_init
                 U __libc_start_main@@GLIBC_2.2.5
0000000000600940 A _edata
0000000000600950 A _end
000000000040066c T _fini
0000000000400460 T _init
00000000004004a4 T _start
00000000004004d0 t call_gmon_start
0000000000600940 b completed.5822
0000000000600930 W data_start
0000000000600948 b dtor_idx.5824
0000000000400560 t frame_dummy
00000000004004a0 T main

With gold I get:
0000000000401720 d _DYNAMIC
00000000004018f8 d _GLOBAL_OFFSET_TABLE_
000000000040063c R _IO_stdin_used
                 w _Jv_RegisterClasses
                 w _ZTI1S
                 w _ZTS1S
                 v _ZTVN10__cxxabiv117__class_type_infoE
                 U _ZdlPv
0000000000401930 d __CTOR_END__
0000000000401928 d __CTOR_LIST__
0000000000401940 d __DTOR_END__
0000000000401938 d __DTOR_LIST__
00000000004006d8 r __FRAME_END__
0000000000401948 d __JCR_END__
0000000000401948 d __JCR_LIST__
0000000000401950 A __bss_start
0000000000401918 D __data_start
0000000000400600 t __do_global_ctors_aux
00000000004004b0 t __do_global_dtors_aux
0000000000401920 d __dso_handle
                 w __gmon_start__
0000000000000000 a __init_array_end
0000000000000000 a __init_array_start
0000000000400560 T __libc_csu_fini
0000000000400570 T __libc_csu_init
                 U __libc_start_main
0000000000401950 A _edata
0000000000401960 A _end
0000000000400658 T _fini
0000000000400640 T _init
0000000000400460 T _start
000000000040048c t call_gmon_start
0000000000401950 b completed.5822
0000000000401918 W data_start
0000000000401958 b dtor_idx.5824
0000000000400520 t frame_dummy
0000000000400550 T main

I think both linker are buggy to insert those entries into final symbol table
when they are not appearing in the output from the linker plugin.

Closing this as GCC bug and will fill it in as linker PR.


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

* [Bug lto/47183] Please discard unused functions
  2011-01-05 17:48 [Bug lto/47183] New: Please discard unused functions d.g.gorbachev at gmail dot com
                   ` (2 preceding siblings ...)
  2011-01-05 23:38 ` hubicka at gcc dot gnu.org
@ 2011-01-06  3:17 ` hubicka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-06  3:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-05 22:51:36 UTC ---
http://sourceware.org/bugzilla/show_bug.cgi?id=12370
now tracks the gold problem
http://sourceware.org/bugzilla/show_bug.cgi?id=12369
now tracks the GNU LD problem.


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

end of thread, other threads:[~2011-01-05 22:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-05 17:48 [Bug lto/47183] New: Please discard unused functions d.g.gorbachev at gmail dot com
2011-01-05 18:06 ` [Bug lto/47183] " pinskia at gcc dot gnu.org
2011-01-05 22:31 ` d.g.gorbachev at gmail dot com
2011-01-05 23:38 ` hubicka at gcc dot gnu.org
2011-01-06  3:17 ` hubicka at gcc dot gnu.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).