From: Peter Samuelson <peter@cadcamlab.org>
To: "J . A . Magallon" <jamagallon@able.es>
Cc: Jakub Jelinek <jakub@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: beware of dead string constants
Date: Tue, 21 Nov 2000 19:14:32 -0600 [thread overview]
Message-ID: <20001121191432.H2918@wire.cadcamlab.org> (raw)
In-Reply-To: <14874.25691.629724.306563@wire.cadcamlab.org> <20001121071327.R1514@devserv.devel.redhat.com> <20001121215145.C748@werewolf.able.es>
In-Reply-To: <20001121215145.C748@werewolf.able.es>; from jamagallon@able.es on Tue, Nov 21, 2000 at 09:51:45PM +0100
[I wrote]
> > > void foo (void)
> > > {
> > > if (0)
> > > printk(KERN_INFO "bar");
> > > }
> > >
[J . A . Magallon]
> Is it related to opt level ? -O3 does auto-inlining and -O2 does not
> (discovered that here, auto inlining in kernel trashes the cache...)
See for yourself. 'gcc -S' is most helpful. The above generates a
string constant "bar\0" for all optimization levels.
Jakub Jelinek claims to have fixed this particular bug in the last week
or so, although I have not downloaded and compiled recent CVS to verify
this. (Didn't someone at some point have a cgi frontend to
CVS-snapshot 'gcc -S'? I can't find it now.)
There is a similar case of scoped 'static' variables, like 'bar' here:
extern void baz (int *);
void foo (void)
{
if (0) {
static int bar[1024]; /* useless 4096-byte hole in bss */
baz(bar);
}
}
and according to Jeff Law, this case is *not* fixed yet.
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-11-22 1:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-21 12:02 Peter Samuelson
2000-11-21 12:13 ` Jakub Jelinek
2000-11-21 12:24 ` Peter Samuelson
2000-11-21 20:51 ` J . A . Magallon
2000-11-22 1:14 ` Peter Samuelson [this message]
2000-11-22 8:27 ` Urban Widmark
2000-11-22 18:48 Michael Elizabeth Chastain
2000-11-23 13:06 ` Werner Almesberger
2000-11-23 23:29 Bernd Eckenfels
2000-11-23 23:39 ` Jeff Garzik
2000-11-24 3:36 ` Peter Samuelson
2000-11-24 4:15 ` Chris Wedgwood
2000-11-26 14:29 Bernd Eckenfels
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=20001121191432.H2918@wire.cadcamlab.org \
--to=peter@cadcamlab.org \
--cc=jakub@redhat.com \
--cc=jamagallon@able.es \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®