public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Martin Sebor <msebor@gmail.com>
Cc: Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] handle bzero/bcopy in DSE and aliasing (PR 80933, 80934)
Date: Wed, 07 Jun 2017 08:23:00 -0000	[thread overview]
Message-ID: <CAFiYyc0s9-HjDCD2msQpvykPhyCvppwMadEddXdrKXnBM20h+Q@mail.gmail.com> (raw)
In-Reply-To: <a504952d-de93-7036-17c7-6a89976b81ed@gmail.com>

On Wed, Jun 7, 2017 at 5:26 AM, Martin Sebor <msebor@gmail.com> wrote:
>> Note I'd be _much_ more sympathetic to simply canonicalizing all of
>> bzero and bcopy
>> to memset / memmove and be done with all the above complexity.
>
>
> Attached is an updated patch along these lines.  Please let me
> know if it matches your expectations.

I think you attached the wrong patch.

Richard.

> FWIW, although I don't feel too strongly about bzero et al. I'm
> not sure that this approach is the right one in general.  It might
> (slightly) simplify GCC itself, but other than the incidental code
> generation improvement, it offers no benefit to users.  In some
> cases, it even degrades user experience by causing GCC issue
> diagnostics that refer to functions that don't appear in the source
> code, such as for:
>
>   char d[1];
>
>   void* f (const void *p)
>   {
>     bzero (d, 7);
>   }
>
>   warning: ‘__builtin_memset’ writing 7 bytes into a region of size 1
> overflows the destination [-Wstringop-overflow=]
>
> For some functions like mempcpy it might even worse code overall
> (slower and bigger).
>
> In other cases (like profiling) it loses interesting information.
>
> I think these types of transformations would be justified  f they
> were done based on measurably improved efficiency of the generated
> code, but I'm uneasy about swapping calls to one function for another
> solely because it simplifies the implementation.  Not least because
> it doesn't seem like a viable general approach to simplifying the
> implementation.
>
> Martin
>
> PS I stopped short of simplifying GCC to remove the existing special
> handling of these three built-ins.  If the patch is approved I'm
> willing to do the cleanup in a subsequent pass.

  reply	other threads:[~2017-06-07  8:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 20:53 Martin Sebor
2017-06-02 11:12 ` Richard Biener
2017-06-04 15:36   ` Bernhard Reutner-Fischer
2017-06-06 16:54     ` Jeff Law
2017-06-07  3:26   ` Martin Sebor
2017-06-07  8:23     ` Richard Biener [this message]
2017-06-07 14:46       ` Martin Sebor
2017-06-07 18:37         ` Bernhard Reutner-Fischer
2017-06-07 20:01           ` Marc Glisse
2017-06-07 20:12             ` Martin Sebor
2017-06-08  2:33               ` Martin Sebor
2017-06-08  7:51                 ` Richard Biener
2017-06-08 16:29                   ` Martin Sebor
2017-06-09 12:35                     ` Richard Biener
2017-06-09 13:04                       ` Jakub Jelinek
2017-06-09 13:36                         ` Richard Biener
2017-06-16 20:52                       ` Martin Sebor
2017-06-07 20:23           ` Joseph Myers

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=CAFiYyc0s9-HjDCD2msQpvykPhyCvppwMadEddXdrKXnBM20h+Q@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@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).