public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/107038] [13 Regression] Bogus -Wstringop-overflow= since r13-2789-gb40b3035879cf695
Date: Mon, 26 Sep 2022 16:16:37 +0000	[thread overview]
Message-ID: <bug-107038-4-ivZAuR2tuC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107038-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Just a quick note from what I see in GDB.  The warning is issued by the 2nd run
of the waccess pass (-fdump-tree-waccess2) for the following statement in bb 22
in pread():

  iftmp.21_88 = __pread_alias (_50, _82, _81, _79);

_81's range reported by range_query::range_of_expr (vr, exp, stmt) is [58,
ULONG_MAX], matching the range in the warning.

A partial output of debug_ranger() for the function is below.  I must be
reading it wrong because  I don't see what the range above is derived from.

=========== BB 19 ============
Imports: recvd_78  _83  
Exports: _51  recvd_78  recvd.17_80  _83  _94  _116  _125  
_83     [irange] UNDEFINED
    <bb 19> [local count: 169058114]:
    if (_83 == 18446744073709551615)
      goto <bb 22>; [34.00%]
    else
      goto <bb 20>; [66.00%]

19->22  (T) _83 :       [irange] UNDEFINED
19->20  (F) _83 :       [irange] UNDEFINED

=========== BB 20 ============
Imports: _81  _83  
Exports: _81  _83  _85  _86  _87  
         _85 : _81(I)  _83(I)  
         _86 : _81(I)  _83(I)  _85  
         _87 : _81(I)  _83(I)  _85  _86  
_81     [irange] long unsigned int VARYING
_83     [irange] long unsigned int VARYING
    <bb 20> [local count: 280636469]:
    _85 = _81 <= _83;
    _86 = (int) _85;
    _87 = __builtin_constant_p (_86);
    if (_87 != 0)
      goto <bb 21>; [50.00%]
    else
      goto <bb 24>; [50.00%]

_86 : [irange] int [0, 1] NONZERO 0x1
_87 : [irange] int [0, 0] NONZERO 0x0
20->21  (T) _81 :       [irange] UNDEFINED
20->21  (T) _83 :       [irange] UNDEFINED
20->21  (T) _85 :       [irange] UNDEFINED
20->21  (T) _86 :       [irange] UNDEFINED
20->21  (T) _87 :       [irange] UNDEFINED
20->24  (F) _86 :       [irange] int [0, 1] NONZERO 0x1
20->24  (F) _87 :       [irange] int [0, 0] NONZERO 0x0

=========== BB 21 ============
Imports: recvd_78  _81  _83  
Exports: _51  recvd_78  recvd.17_80  _81  _83  _94  _116  _125  
_81     [irange] UNDEFINED
_83     [irange] UNDEFINED
    <bb 21> [local count: 140318235]:
    if (_81 <= _83)
      goto <bb 22>; [50.00%]
    else
      goto <bb 23>; [50.00%]

21->22  (T) _81 :       [irange] UNDEFINED
21->22  (T) _83 :       [irange] UNDEFINED
21->23  (F) _81 :       [irange] UNDEFINED
21->23  (F) _83 :       [irange] UNDEFINED

=========== BB 22 ============
    <bb 22> [local count: 127638877]:
    iftmp.21_88 = __pread_alias (_50, _82, _81, _79);
    goto <bb 25>; [100.00%]

  parent reply	other threads:[~2022-09-26 16:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26  8:36 [Bug tree-optimization/107038] New: " marxin at gcc dot gnu.org
2022-09-26  9:30 ` [Bug tree-optimization/107038] " rguenth at gcc dot gnu.org
2022-09-26 14:29 ` siddhesh at gcc dot gnu.org
2022-09-26 14:31 ` marxin at gcc dot gnu.org
2022-09-26 16:16 ` msebor at gcc dot gnu.org [this message]
2022-09-26 18:32 ` siddhesh at gcc dot gnu.org
2022-09-26 18:41 ` siddhesh at gcc dot gnu.org
2022-09-26 19:16 ` marxin at gcc dot gnu.org
2022-10-07 19:06 ` [Bug tree-optimization/107038] Bogus -Wstringop-overflow in dead code siddhesh at gcc dot gnu.org
2022-10-07 19:08 ` siddhesh at gcc dot gnu.org
2022-10-07 19:09 ` siddhesh at gcc dot gnu.org
2023-04-26  6:56 ` rguenth at gcc dot gnu.org
2023-07-27  9:23 ` rguenth at gcc dot gnu.org

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-107038-4-ivZAuR2tuC@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).