public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Martin Sebor <msebor@gmail.com>,
	Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] look harder for MEM_REF operand equality to avoid -Wstringop-truncation (PR 84561)
Date: Thu, 04 Oct 2018 03:08:00 -0000	[thread overview]
Message-ID: <a0434335-911a-4d0e-670d-6215aa3cccd2@redhat.com> (raw)
In-Reply-To: <4aa12e16-f1ab-4311-ac4e-0050ce3c9218@gmail.com>

On 9/19/18 8:19 AM, Martin Sebor wrote:
> 
> The restrict pass doesn't know about string lengths so it can't
> handle all the warnings about string built-ins (the strlen pass
> now calls into it to issue some).  The strlen pass does so it
> could handle most if not all of them (the folder also calls
> into it to issue some warnings).  It would work even better if
> it were also integrated with the object size pass.
> 
> We're already working on merging strlen with sprintf.  It seems
> to me that the strlen pass would benefit not only from that but
> also from integrating with object size and warn-restrict.  With
> that, -Wstringop-overflow could be moved from builtins.c into
> it as well (and also benefit not only from accurate string
> lengths but also from the more accurate object size info).
> 
> What do you think about that?
Well, given that Wrestrict is already a DOM walk integrating it with
sprintf and strlen would be fairly natural.   In that model we'd come up
with some clever name for the pass.  It'd have an embedded strlen (and
perhaps objsize) analysis.  It's walker would dispatch each statement to
the restrict or sprintf & strlen checker.

> 
> Martin
> 
> PS I don't think I could do more than merger strlen and sprintf
> before stage 1 ends (if even that much) so this would be a longer
> term goal.
Given the time lost to the STRING_CST and range issues, agreed.  It's
not going to happen this stage1.

Jeff

  parent reply	other threads:[~2018-10-04  3:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30  0:12 Martin Sebor
2018-08-30  8:35 ` Richard Biener
2018-08-30 16:54   ` Martin Sebor
2018-08-30 17:22     ` Richard Biener
2018-08-30 17:39       ` Martin Sebor
2018-08-31 10:07         ` Richard Biener
2018-09-12 18:03           ` Martin Sebor
2018-09-14 21:35             ` Jeff Law
2018-09-14 23:44               ` Martin Sebor
2018-09-17 23:13                 ` Jeff Law
2018-09-18 17:38                   ` Martin Sebor
2018-09-18 19:24                     ` Jeff Law
2018-09-18 20:01                       ` Martin Sebor
2018-09-19  5:40                         ` Jeff Law
2018-09-19 14:31                           ` Martin Sebor
2018-09-20  9:21                             ` Richard Biener
2018-09-21 14:50                               ` Martin Sebor
2018-10-01 21:46                                 ` [PING] " Martin Sebor
2018-10-08 22:03                                   ` [PING #2] " Martin Sebor
2018-10-31 17:11                                     ` [PING #3] " Martin Sebor
2018-11-16  3:09                                       ` [PING #4] " Martin Sebor
2018-11-16  8:46                                         ` Richard Biener
2018-11-19 14:55                                           ` Jeff Law
2018-11-19 16:27                                           ` Martin Sebor
2018-11-20  9:23                                             ` Richard Biener
2018-10-04  3:08                             ` Jeff Law [this message]
2018-09-19 13:51                       ` Richard Biener
2018-09-15  8:43 Bernd Edlinger
2018-09-17 17:34 ` Jeff Law
2018-09-17 17:50   ` Richard Biener
2018-09-17 18:41     ` Bernd Edlinger
2018-09-17 21:18     ` Martin Sebor
2018-09-18  0:17       ` Jeff Law
2018-09-18  2:49         ` Martin Sebor

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=a0434335-911a-4d0e-670d-6215aa3cccd2@redhat.com \
    --to=law@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.com \
    --cc=richard.guenther@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).