public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/30908]  New: -Os inlines functions that are called more than once (optimization regression)
@ 2007-02-21 11:48 j at uriah dot heep dot sax dot de
  2007-02-21 11:50 ` [Bug c/30908] " j at uriah dot heep dot sax dot de
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: j at uriah dot heep dot sax dot de @ 2007-02-21 11:48 UTC (permalink / raw)
  To: gcc-bugs

This has been observed for the AVR target, but could perhaps also apply to
other targets.

Recent versions of GCC (4.1.1 and 4.3.0 trunk are confirmed) tend to inline
static functions with -Os even when they are being called more than once,
thus resulting in larger code than necessary.  This violates the objective
of -Os to only apply those additional optimizations from level 2 that will
not increase the code size.

GCC 3.x versions did not do this, so it's an optimization regression.

Compiling the attached simple code snippet (which is completely independent
of the AVR target) with -Os, and either with or without -DNOINLINE yields:

...
/* function main size 17 (13) */
...

/* function main size 31 (27) */
...


-- 
           Summary: -Os inlines functions that are called more than once
                    (optimization regression)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: j at uriah dot heep dot sax dot de
GCC target triplet: avr-*-*


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


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

end of thread, other threads:[~2010-09-08  9:50 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-21 11:48 [Bug c/30908] New: -Os inlines functions that are called more than once (optimization regression) j at uriah dot heep dot sax dot de
2007-02-21 11:50 ` [Bug c/30908] " j at uriah dot heep dot sax dot de
2007-02-21 12:34 ` rguenth at gcc dot gnu dot org
2007-02-21 12:35 ` rguenth at gcc dot gnu dot org
2007-02-21 12:58 ` j at uriah dot heep dot sax dot de
2007-02-21 14:36 ` rguenth at gcc dot gnu dot org
2007-02-21 14:47 ` j at uriah dot heep dot sax dot de
2007-02-21 15:11 ` [Bug middle-end/30908] " pinskia at gcc dot gnu dot org
2007-02-21 17:19 ` j at uriah dot heep dot sax dot de
2007-02-21 17:27 ` hubicka at gcc dot gnu dot org
2007-02-21 17:42 ` steven at gcc dot gnu dot org
2007-02-21 19:32 ` j at uriah dot heep dot sax dot de
2007-02-21 19:32 ` j at uriah dot heep dot sax dot de
2007-02-21 19:33 ` j at uriah dot heep dot sax dot de
2007-02-21 19:38 ` pinskia at gcc dot gnu dot org
2007-02-21 19:51 ` j at uriah dot heep dot sax dot de
2007-02-24  9:12 ` pinskia at gcc dot gnu dot org
2007-02-24  9:14 ` [Bug middle-end/30908] tree cost for types which are > WORD_SIZE pinskia at gcc dot gnu dot org
2007-04-10 14:35 ` giovannibajo at libero dot it
2008-04-08 10:03 ` rguenth at gcc dot gnu dot org
2009-01-15 11:15 ` m dot reszat at kostal dot com
2010-09-08  9:50 ` abnikant dot singh at atmel dot com

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