public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dje at transmeta dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/13842] New: static inline erroneously emitted
Date: Sat, 24 Jan 2004 01:48:00 -0000	[thread overview]
Message-ID: <20040124014837.13842.dje@transmeta.com> (raw)

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


             reply	other threads:[~2004-01-24  1:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-24  1:48 dje at transmeta dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040124014837.13842.dje@transmeta.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).