public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13842] New: static inline erroneously emitted
@ 2004-01-24  1:48 dje at transmeta dot com
  2004-01-24  2:03 ` [Bug c/13842] [3.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dje at transmeta dot com @ 2004-01-24  1:48 UTC (permalink / raw)
  To: gcc-bugs

static inline functions are not emitted if they are not referenced.
The following case may fall on the boundary, however it use to work
(e.g. in gcc 2.96) and it works in gcc 3.4, so I'm guessing this is
a regression in the 3.3 branch.
I was able to recreate the problem with the current head of the gcc-3_3-branch
branch.

Consider:

static inline int foo (void);

static inline int
foocaller (void)
{
    return foo ();
}

extern int bar (void);

extern int blah;

static inline int
foo (void)
{
    return bar ();
}

int
lala (void)
{
    return blah;
}

bash$ gcc-3.3.3 -c -O2 -fno-inline foo.c
bash$ nm foo.o
         U bar
         U blah
00000000 t foo
0000000c T lala

Note that `foo' has been emitted.
[which isn't that big a deal except that an undefined reference has
also been emitted that didn't get emitted before]

Again, given the presence of -fno-inline,
whether y'all want to declare this a bug or not is up for discussion
I guess.  However, this use to work, and it works in the gcc 3.4 branch,
thus I'm guessing this is a regression.
[where "works" means `foo' and the undefined reference to `bar' do
not get emitted]

-- 
           Summary: static inline erroneously emitted
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dje at transmeta dot com
                CC: gcc-bugs at gcc dot gnu dot org
 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=13842


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

end of thread, other threads:[~2005-04-30 14:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-24  1:48 [Bug c/13842] New: static inline erroneously emitted dje at transmeta dot com
2004-01-24  2:03 ` [Bug c/13842] [3.3 Regression] " pinskia at gcc dot gnu dot org
2004-01-24  2:13 ` [Bug c/13842] [3.3 Regression] static inline emitted when not used dje at transmeta dot com
2004-02-15 12:41 ` gdr at gcc dot gnu dot org
2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
2004-09-28 13:25 ` gdr at gcc dot gnu dot org
2004-09-28 13:29 ` pinskia at gcc dot gnu dot org
2004-09-28 13:53 ` gdr at cs dot tamu dot edu
2004-12-28  2:15 ` pinskia at gcc dot gnu dot org
2004-12-28  2:15 ` pinskia at gcc dot gnu dot org
2005-04-30 13:30 ` gdr at gcc dot gnu dot org
2005-04-30 14:32 ` gdr 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).