public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, Martin Sebor <msebor@redhat.com>
Subject: Re: [PATCH] Adjust gimple-ssa-sprintf.c for irange API.
Date: Tue, 4 Aug 2020 08:39:31 -0600	[thread overview]
Message-ID: <05c2c972-7a36-cf3f-efcc-99614bf6b3ef@gmail.com> (raw)
In-Reply-To: <CAGm3qMXrm4yznzLUizpBKxbwC47VoK8vWn3udwLs_r_m8ozSrQ@mail.gmail.com>

On 8/4/20 8:11 AM, Aldy Hernandez wrote:
> On Tue, Aug 4, 2020 at 3:59 PM Martin Sebor <msebor@gmail.com> wrote:
>>
>> On 8/4/20 5:21 AM, Aldy Hernandez via Gcc-patches wrote:
>>> This is a rather obvious patch, but I'd like a nod before committing.
>>>
>>> Martin, I've removed your anti-range check, as it is subsumed by the
>>> lower_bound/upper_bound code.  However, you will have to adapt the code
>>> for multi-ranges if desired.  For example, you may want to loop through the
>>> sub-ranges and do the right thing.  Look at value-range.h and see the comments
>>> for class irange.  Those are the methods you should stick to.
>>>
>>> i.e.
>>>        for (i=0; i < vr->num_pairs(); ++i)
>>>                stuff_with(vr->lower_bound(i), vr->upper_bound(i))
>>>
>>> There should be no functional changes with this patch.
>>
>> I have no concern with this change but I appreciate the heads
>> up and the tip on how to add the multi-range support.  Just
>> one suggestion: I'd prefer to keep the comment about the POSIX
>> requirement somewhere just as a reminder.
> 
> The comment is still there, as you had a duplicate one further up:
> 
>   else if (dstsize > target_int_max ())
>          {
>            warning_at (gimple_location (info.callstmt), info.warnopt (),
>                "specified bound %wu exceeds %<INT_MAX%>",
>                dstsize);
>            /* POSIX requires snprintf to fail if DSTSIZE is greater
>           than INT_MAX.  Avoid folding in that case.  */
>            posunder4k = false;
>          }
> 
> Are you ok with this, or would you rather me copy that comment somewhere else?

I'm fine with it as is, I didn't see the other copy.

Thanks!
Martin

      reply	other threads:[~2020-08-04 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 11:21 Aldy Hernandez
2020-08-04 13:59 ` Martin Sebor
2020-08-04 14:11   ` Aldy Hernandez
2020-08-04 14:39     ` Martin Sebor [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=05c2c972-7a36-cf3f-efcc-99614bf6b3ef@gmail.com \
    --to=msebor@gmail.com \
    --cc=aldyh@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@redhat.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).