From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Harvey Harrison <harvey.harrison@gmail.com>,
Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] bitops: simplify generic bit finding functions
Date: Sun, 27 Apr 2008 22:02:35 +0100 [thread overview]
Message-ID: <20080427210235.GX5882@ZenIV.linux.org.uk> (raw)
In-Reply-To: <alpine.LFD.1.10.0804271335330.3119@woody.linux-foundation.org>
On Sun, Apr 27, 2008 at 01:38:34PM -0700, Linus Torvalds wrote:
> It happens because the warning is done as part of constant expression
> evaluation, but then the expression isn't actually *used*, so when we
> optimize it away - at a later date - it's too late to undo the warning.
>
> I don't rightly know how to fix it. We do want to do the constant
> evaluation early (since all the optimizations that may then make it a
> non-issue depends on constants being constants!), but in order to not
> output the warning we'd have to turn the constant into a "constant with
> warning 'xyz' if used".
>
> Which we have no support for in sparse yet.
It's not even a constant, really... What we need is
* don't fold further if that sucker would be evaluated (i.e. 0 && <...>
is folded, 0 & <...> is not)
* don't consider an integer constant expression with value 0 for
purposes of null pointer constant handling
* emit corresponding insn in linearize_expression() when we run into
such sucker.
* somewhere around the call of vrfy_flow() walk through insns in
remaining bb (we'd done dead code elimination already) and spew postponed
warning on each such insn. Probably. Assuming that I'm not entirely
confused about what's going on in that area - which is quite possible.
Folks, could somebody familiar with the backend comment on the last part?
next prev parent reply other threads:[~2008-04-27 21:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-27 20:19 [PATCH] bitops: simplify generic bit finding functions Harvey Harrison
2008-04-27 20:26 ` Linus Torvalds
2008-04-27 20:29 ` Harvey Harrison
2008-04-27 20:36 ` Al Viro
2008-04-27 20:38 ` Harvey Harrison
2008-04-27 20:38 ` Linus Torvalds
2008-04-27 21:02 ` Al Viro [this message]
2008-04-28 14:04 ` Thomas Gleixner
2008-04-28 15:10 ` Alexander van Heukelum
2008-04-28 15:58 ` Thomas Gleixner
2008-04-28 16:25 ` Linus Torvalds
2008-04-28 16:47 ` Thomas Gleixner
2008-04-28 16:54 ` Linus Torvalds
2008-04-28 19:26 ` Thomas Gleixner
2008-04-28 19:37 ` Linus Torvalds
2008-04-28 21:55 ` Ingo Molnar
2008-04-29 10:01 ` [PATCH] bitops: remove "optimizations" Thomas Gleixner
2008-04-29 10:03 ` David Miller
2008-04-29 12:34 ` David Miller
2008-04-29 14:20 ` Ingo Molnar
2008-04-29 22:31 ` David Miller
2008-04-29 16:51 ` Thomas Gleixner
2008-04-29 22:58 ` David Miller
2008-04-29 23:30 ` David Miller
2008-04-28 19:57 ` [PATCH] bitops: simplify generic bit finding functions Andi Kleen
2008-04-28 14:58 ` Alexander van Heukelum
2008-04-28 14:32 ` Alexander van Heukelum
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=20080427210235.GX5882@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=harvey.harrison@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@linux-foundation.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