public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108306] New: false-positive -Warray-bounds warning emitted with -fsanitize=shift
@ 2023-01-05 20:46 kees at outflux dot net
  2023-01-05 20:50 ` [Bug c/108306] " kees at outflux dot net
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: kees at outflux dot net @ 2023-01-05 20:46 UTC (permalink / raw)
  To: gcc-bugs

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];
      |       ^

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-01-30 21:12 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 20:46 [Bug c/108306] New: false-positive -Warray-bounds warning emitted with -fsanitize=shift kees at outflux dot net
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

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).