public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28470]  New: does not inline constant funargs
@ 2006-07-24 17:43 gcc-bugzilla at gcc dot gnu dot org
  2006-07-24 19:41 ` [Bug c/28470] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2006-07-24 17:43 UTC (permalink / raw)
  To: gcc-bugs


Observing it at least on stage 1 compiler, and exactly the same way as
in 3.3.2.

If inline function, later called a functional, is passed a function
argument that is constant and inline, and said argument is called in
the functional body, and when inline expansions are on, compiler
expand inline only said functional, but not function argument calls in
said expansion.  Instead, it handles these calls just like those of
non- inline function, that is, outputs uninlined function body and
call instruction of that body, with all call overhead.

If argument is a nested function, 4.0.3 behaves a bit better than
3.3.2.  It does not output full trampoline code unnecessarily.

Priority?  How should I know?  Depends on projects using the compiler.

Environment:
System: Linux way2go 2.6.3-27mdk #1 Tue May 31 21:48:42 MDT 2005 i686 unknown
unknown GNU/Linux
Architecture: i686

host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../share/src/gcc-4.0.3/configure --enable-languages=c

How-To-Repeat:
Compile with `-O99'.  `do_it_cb' code is output as a separate funtion,
and code output for `do_it_with_g_set_v0' calls `do_it_cb', not
`do_it'.

extern int g_set_v0 (void);
extern void g_restore_v (int);
extern void do_it (void);

static inline
with_g_set_v0 (void (f) (void))
{
  int v = g_set_v0 ();
  f ();
  g_restore_v (v);
}

static inline void
do_it_cb (void)
{
  do_it ();
}

void
do_it_with_g_set_v0 (void)
{
  with_g_set_v0 (do_it_cb);
}


-- 
           Summary: does not inline constant funargs
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gin at mo dot msk dot ru
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c/28470] does not inline constant funargs
  2006-07-24 17:43 [Bug c/28470] New: does not inline constant funargs gcc-bugzilla at gcc dot gnu dot org
@ 2006-07-24 19:41 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-24 19:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-07-24 19:41 -------


*** This bug has been marked as a duplicate of 9079 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2006-07-24 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-24 17:43 [Bug c/28470] New: does not inline constant funargs gcc-bugzilla at gcc dot gnu dot org
2006-07-24 19:41 ` [Bug c/28470] " 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).