public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/94021] -Wformat-truncation false positive due to excessive integer range
Date: Wed, 21 Jun 2023 04:33:26 +0000	[thread overview]
Message-ID: <bug-94021-4-gUsUOJPiV0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94021-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94021

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |13.0

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC 13:
  # RANGE [irange] int [0, 59] NONZERO 0x3f
  m_10 = _1 / 60;
  # RANGE [irange] int [0, 24] NONZERO 0x1f
  h_9 = _5 / 3600;

GCC 12:
  # RANGE [0, 59] NONZERO 63
  m_10 = _1 / 60;
  # RANGE [0, 596523] NONZERO 1048575
  h_9 = _5 / 3600;

And the warning is gone in GCC 13 too.

And produces:
/app/example.cpp:14: snprintfD.1756: objsize = 8, fmtstr = "%s%02i%02i"
  Directive 1 at offset 0: "%s"
    Result: 1, 1, 1, 1 (1, 1, 1, 1)
  Directive 2 at offset 2: "%02i"
    Result: 2, 2, 2, 2 (3, 3, 3, 3)
  Directive 3 at offset 6: "%02i"
    Result: 2, 2, 2, 2 (5, 5, 5, 5)
  Directive 4 at offset 10: "", length = 1
  Substituting 5 for return value.

      parent reply	other threads:[~2023-06-21  4:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-94021-4@http.gcc.gnu.org/bugzilla/>
2020-12-17 17:14 ` msebor at gcc dot gnu.org
2021-01-04 15:34 ` amacleod at redhat dot com
2023-04-14  5:48 ` ishikawa at yk dot rim.or.jp
2023-06-21  4:33 ` pinskia at gcc dot gnu.org [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=bug-94021-4-gUsUOJPiV0@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).