public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/109298] warning: array subscript ‘...’ is partly outside array bounds of ‘...’
Date: Tue, 28 Mar 2023 07:07:02 +0000	[thread overview]
Message-ID: <bug-109298-4-2AkpNlNIzf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109298-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |tree-optimization
     Ever confirmed|0                           |1
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
             Blocks|                            |56456
   Last reconfirmed|                            |2023-03-28

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

<bb 2> [local count: 1073741824]:
packet_4 = __builtin_malloc (40);
_1 = &packet_4->data;
__builtin_memcpy (_1, buf_5(D), 36);
_7 = MEM[(struct ib_rmpp_mad *)packet_4 + 4B].class;
return _7;

the issue is that rmpp_mad->class is considered a dereference of rmpp_mad
where ib_rmpp_mad doesn't fit in the allocation.  The wording of the
diagnostic is just very confusing here.

How the fix to the driver should look like probably depends on the actual
source - for the reduced testcase the allocation/copying doesn't make sense
while for the actual driver it probably does.

As said above, the diagnostic wording could be improved, so confirmed.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456
[Bug 56456] [meta-bug] bogus/missing -Warray-bounds

      reply	other threads:[~2023-03-28  7:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 12:59 [Bug c/109298] New: " ubizjak at gmail dot com
2023-03-28  7:07 ` rguenth 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-109298-4-2AkpNlNIzf@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).