public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c/35728] New: Inlined function via function pointer emitted unnecessarily
@ 2008-03-28 2:38 rusty at rustcorp dot com dot au
2008-03-28 10:16 ` [Bug c/35728] " rguenth at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: rusty at rustcorp dot com dot au @ 2008-03-28 2:38 UTC (permalink / raw)
To: gcc-bugs
>From http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079 now we get:
.file "foo.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello World.\n"
.text
.p2align 4,,15
.type funk, @function
funk:
pushl %ebp
movl $.LC0, %eax
movl %esp, %ebp
popl %ebp
ret
.size funk, .-funk
.section .rodata.str1.1
.LC1:
.string "Hello World."
.text
.p2align 4,,15
.globl main
.type main, @function
main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
pushl %ecx
subl $4, %esp
movl $.LC1, (%esp)
call puts
addl $4, %esp
popl %ecx
popl %ebp
leal -4(%ecx), %esp
ret
.size main, .-main
.ident "GCC: (Ubuntu 4.3.0-1ubuntu1) 4.3.0"
.section .note.GNU-stack,"",@progbits
Note funk (a static function) is unused, and successfully inlined, but still
omitted. Replicated on powerpc as well, so not x86-specific.
--
Summary: Inlined function via function pointer emitted
unnecessarily
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rusty at rustcorp dot com dot au
GCC build triplet: i386-linux-gnu-gcc-4.1
GCC host triplet: i386-linux-gnu-gcc-4.1
GCC target triplet: i386-linux-gnu-gcc-4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35728
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/35728] Inlined function via function pointer emitted unnecessarily 2008-03-28 2:38 [Bug c/35728] New: Inlined function via function pointer emitted unnecessarily rusty at rustcorp dot com dot au @ 2008-03-28 10:16 ` rguenth at gcc dot gnu dot org 2008-09-06 12:11 ` hubicka at gcc dot gnu dot org ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: rguenth at gcc dot gnu dot org @ 2008-03-28 10:16 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from rguenth at gcc dot gnu dot org 2008-03-28 10:15 ------- Hm, interesting. Do we not remove unused functions after final inlining? -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu dot | |org Keywords| |missed-optimization http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35728 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/35728] Inlined function via function pointer emitted unnecessarily 2008-03-28 2:38 [Bug c/35728] New: Inlined function via function pointer emitted unnecessarily rusty at rustcorp dot com dot au 2008-03-28 10:16 ` [Bug c/35728] " rguenth at gcc dot gnu dot org @ 2008-09-06 12:11 ` hubicka at gcc dot gnu dot org 2008-12-03 1:49 ` [Bug middle-end/35728] " pinskia at gcc dot gnu dot org 2008-12-03 1:49 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: hubicka at gcc dot gnu dot org @ 2008-09-06 12:11 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from hubicka at gcc dot gnu dot org 2008-09-06 12:09 ------- We eliminate functions, but we never re-scan program to see if the function has no longer address taken. To implement this we will need to add to cgraph list of functions/variables taking address of each function/variable and update the list as we optimize... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35728 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/35728] Inlined function via function pointer emitted unnecessarily 2008-03-28 2:38 [Bug c/35728] New: Inlined function via function pointer emitted unnecessarily rusty at rustcorp dot com dot au 2008-03-28 10:16 ` [Bug c/35728] " rguenth at gcc dot gnu dot org 2008-09-06 12:11 ` hubicka at gcc dot gnu dot org @ 2008-12-03 1:49 ` pinskia at gcc dot gnu dot org 2008-12-03 1:49 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2008-12-03 1:49 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from pinskia at gcc dot gnu dot org 2008-12-03 01:41 ------- Confirmed. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Component|c |middle-end Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2008-12-03 01:41:37 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35728 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/35728] Inlined function via function pointer emitted unnecessarily 2008-03-28 2:38 [Bug c/35728] New: Inlined function via function pointer emitted unnecessarily rusty at rustcorp dot com dot au ` (2 preceding siblings ...) 2008-12-03 1:49 ` [Bug middle-end/35728] " pinskia at gcc dot gnu dot org @ 2008-12-03 1:49 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2008-12-03 1:49 UTC (permalink / raw) To: gcc-bugs ------- Comment #4 from pinskia at gcc dot gnu dot org 2008-12-03 01:41 ------- *** Bug 38378 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |patrick at motec dot com dot | |au http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35728 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-12-03 1:49 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-03-28 2:38 [Bug c/35728] New: Inlined function via function pointer emitted unnecessarily rusty at rustcorp dot com dot au 2008-03-28 10:16 ` [Bug c/35728] " rguenth at gcc dot gnu dot org 2008-09-06 12:11 ` hubicka at gcc dot gnu dot org 2008-12-03 1:49 ` [Bug middle-end/35728] " pinskia at gcc dot gnu dot org 2008-12-03 1:49 ` pinskia 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).