public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kees at outflux dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/108306] New: false-positive -Warray-bounds warning emitted with -fsanitize=shift
Date: Thu, 05 Jan 2023 20:46:18 +0000	[thread overview]
Message-ID: <bug-108306-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 108306
           Summary: false-positive -Warray-bounds warning emitted with
                    -fsanitize=shift
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kees at outflux dot net
  Target Milestone: ---

Created attachment 54198
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54198&action=edit
reduced PoC

This seems similar to bug #105679, but is still present in GCC 13 (and 12).
Something about -fsanitize=shift really confuses -Warray-bounds:

poc2.c: In function 'e':
poc2.c:12:8: warning: array subscript 32 is above array bounds of 'int[4]'
[-Warray-bounds=]
   12 |     c.d[f]++;
      |     ~~~^~~
poc2.c:4:7: note: while referencing 'd'
    4 |   int d[MAX];
      |       ^
poc2.c:12:8: warning: array subscript 32 is above array bounds of 'int[4]'
[-Warray-bounds=]
   12 |     c.d[f]++;
      |     ~~~^~~
poc2.c:4:7: note: while referencing 'd'
    4 |   int d[MAX];
      |       ^

             reply	other threads:[~2023-01-05 20:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 20:46 kees at outflux dot net [this message]
2023-01-05 20:50 ` [Bug c/108306] " kees at outflux dot net
2023-01-05 20:52 ` kees at outflux dot net
2023-01-05 21:25 ` kees at outflux dot net
2023-01-06  6:31 ` [Bug tree-optimization/108306] " pinskia at gcc dot gnu.org
2023-01-09 11:24 ` rguenth at gcc dot gnu.org
2023-01-14  0:15 ` kees at outflux dot net
2023-01-14  0:16 ` kees at outflux dot net
2023-01-16  9:43 ` rguenth at gcc dot gnu.org
2023-01-16  9:47 ` [Bug tree-optimization/108306] [12/13 Regression] " rguenth at gcc dot gnu.org
2023-01-16 19:36 ` amacleod at redhat dot com
2023-01-16 20:26 ` amacleod at redhat dot com
2023-01-17  8:47 ` rguenth at gcc dot gnu.org
2023-01-27 14:38 ` cvs-commit at gcc dot gnu.org
2023-01-27 14:39 ` amacleod at redhat dot com
2023-01-27 15:16 ` [Bug tree-optimization/108306] [12 " rguenth at gcc dot gnu.org
2023-01-27 16:31 ` amacleod at redhat dot com
2023-01-30  7:02 ` rguenther at suse dot de
2023-01-30 21:12 ` cvs-commit at gcc dot gnu.org
2023-01-30 21:12 ` amacleod at redhat dot com

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