public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [RFA] Improve initialization of objects when the initializer has trailing zeros.
Date: Fri, 8 Jul 2022 09:11:36 +0200	[thread overview]
Message-ID: <CAFiYyc3TS4qSHZSJy+ER+O8Rx=7YVF9+MbTTSpTSObzDxMi5Qg@mail.gmail.com> (raw)
In-Reply-To: <446ea3de-5486-8756-47f1-7822d79c5d75@gmail.com>

On Thu, Jul 7, 2022 at 4:46 PM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> This is an update to a patch originally posted by Takayuki Suwa a few
> months ago.
>
> When we initialize an array from a STRING_CST we perform the
> initialization in two steps.  The first step copies the STRING_CST to
> the destination.  The second step uses clear_storage to initialize
> storage in the array beyond TREE_STRING_LENGTH of the initializer.
>
> Takayuki's patch added a special case when the STRING_CST itself was all
> zeros which would avoid the copy from the STRING_CST and instead do all
> the initialization via clear_storage which is clearly more runtime
> efficient.
>
> Richie had the suggestion that instead of special casing when the entire
> STRING_CST was NULs  to instead identify when the tail of the STRING_CST
> was NULs.   That's more general and handles Takayuki's case as well.
>
> Bootstrapped and regression tested on x86_64-linux-gnu.  Given I rewrote
> Takayuki's patch I think it needs someone else to review rather than
> self-approving.
>
> OK for the trunk?

OK.

Thanks,
Richard.

> Jeff
>

      parent reply	other threads:[~2022-07-08  7:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 14:46 Jeff Law
2022-07-08  0:06 ` Takayuki 'January June' Suwa
2022-07-08  7:11 ` Richard Biener [this message]

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='CAFiYyc3TS4qSHZSJy+ER+O8Rx=7YVF9+MbTTSpTSObzDxMi5Qg@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    /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).