From: Segher Boessenkool <segher@kernel.crashing.org>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: GCC patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Rename nonzero_bits to known_zero_bits.
Date: Fri, 21 Oct 2022 11:45:33 -0500 [thread overview]
Message-ID: <20221021164533.GW25951@gate.crashing.org> (raw)
In-Reply-To: <20221021131426.308205-1-aldyh@redhat.com>
Hi!
On Fri, Oct 21, 2022 at 03:14:26PM +0200, Aldy Hernandez via Gcc-patches wrote:
> The name nonzero_bits is confusing. We're not tracking nonzero bits.
> We're tracking known-zero bits, or at the worst we're tracking "maye
> nonzero bits". But really, the only thing we're sure about in the
> "nonzero" bits are the bits that are zero, which are known to be 0.
> We're not tracking nonzero bits.
Indeed.
> I know we've been carrying around this name forever, but the fact that
> both of the maintainers of the code *HATE* it, should be telling.
> Also, we'd also like to track known-one bits in the irange, so it's
> best to keep the nomenclature consistent.
And that as well.
However:
> * asan.cc (handle_builtin_alloca): Rename *nonzero* to *known_zero*.
Our "nonzero" means "not known to be zero", not "known to be zero", so
this renaming makes it worse than it was. Rename it to
"not_known_zero", make that a thin wrapper around a new "known_zero",
and slowly get rid of not_known_zero?
> --- a/gcc/asan.cc
> +++ b/gcc/asan.cc
> @@ -816,7 +816,7 @@ handle_builtin_alloca (gcall *call, gimple_stmt_iterator *iter)
> tree redzone_size = build_int_cst (size_type_node, ASAN_RED_ZONE_SIZE);
>
> /* Extract lower bits from old_size. */
> - wide_int size_nonzero_bits = get_nonzero_bits (old_size);
> + wide_int size_nonzero_bits = get_known_zero_bits (old_size);
Such variables should also be renamed :-(
Segher
next prev parent reply other threads:[~2022-10-21 16:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 13:14 Aldy Hernandez
2022-10-21 16:45 ` Segher Boessenkool [this message]
2022-10-21 16:51 ` Jakub Jelinek
2022-10-21 16:54 ` Jakub Jelinek
2022-10-21 18:00 ` Segher Boessenkool
2022-11-01 16:33 ` Aldy Hernandez
2022-10-21 17:44 ` Segher Boessenkool
2022-10-24 7:21 ` Richard Biener
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=20221021164533.GW25951@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=aldyh@redhat.com \
--cc=gcc-patches@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).