From: Jeff Law <law@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>,
Richard Biener <rguenther@suse.de>,
Martin Sebor <msebor@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478, take 2 and 3)
Date: Wed, 21 Feb 2018 03:56:00 -0000 [thread overview]
Message-ID: <e6fbb839-1a6c-3b09-033b-75668aadaffe@redhat.com> (raw)
In-Reply-To: <20180220213446.GK5867@tucnak>
On 02/20/2018 02:34 PM, Jakub Jelinek wrote:
> On Tue, Feb 20, 2018 at 01:13:13PM -0700, Martin Sebor wrote:
>> A safer and even more conservative alternative that should be
>> equivalent to your approach while avoiding the sprintf regressions
>> is to add another mode to the function and have it clear *minlen
>> as an option. This lets the strlen code obtain the conservative
>> lower bound without compromising the sprintf warnings.
>
> I fail to see what it would be good for to set *MINLEN to zero and
> *MAXLEN to all ones for the non-warning use cases, we simply don't know
> anything about it, both NULL_TREEs i.e. returning false is better. I'm
> offering two alternate patches which use
> fuzzy == 0 for the previous !fuzzy, fuzzy == 1 for conservatively correct
> code that assumes strlen can't cross field/variable boundaries in
> compliant programs and fuzzy == 2 which does that + whatever the warning
> code wants. Additionally, I've rewritten the COND_EXPR handling, so that
> it matches exactly the PHI handling.
>
> The first patch doesn't change the 2 argument get_range_strlen and changes
> gimple_fold_builtin_strlen to use the 6 argument one, the second patch
> changes also the 2 argument get_range_strlen similarly to what you've done
> in your patch.
>
> Tested on x86_64-linux and i686-linux, ok for trunk if it passes
> bootstrap/regtest? Which one?
Just to be clear, the encapsulation proposal is a gcc-9 thingie. I
don't think we need that to move forward.
jeff
next prev parent reply other threads:[~2018-02-21 3:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-20 17:49 [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478) Jakub Jelinek
2018-02-20 19:03 ` Martin Sebor
2018-02-20 20:13 ` Martin Sebor
2018-02-21 0:49 ` [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478, take 2 and 3) Jakub Jelinek
2018-02-20 22:49 ` Martin Sebor
2018-02-21 3:56 ` Jeff Law [this message]
2018-02-21 3:56 ` Jeff Law
2018-02-21 14:49 ` Jakub Jelinek
2018-02-21 3:36 ` [PATCH] Fix pdftex miscompilation due to get_range_strlen (PR tree-optimization/84478) Jeff Law
2018-02-20 20:49 ` Jakub Jelinek
2018-02-20 23:59 ` Martin Sebor
2018-02-21 3:25 ` Jeff Law
2018-02-21 15:49 ` Martin Sebor
2018-02-22 7:39 ` Richard Biener
2018-02-21 7:49 ` Jakub Jelinek
2018-02-21 1:00 ` Martin Sebor
2018-02-21 3:31 ` Jeff Law
2018-02-21 8:49 ` Jakub Jelinek
2018-02-21 3:42 ` Jeff Law
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=e6fbb839-1a6c-3b09-033b-75668aadaffe@redhat.com \
--to=law@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=msebor@gmail.com \
--cc=rguenther@suse.de \
/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).