public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105679] New: erroneous -Warray-bounds warning with sanitizer
@ 2022-05-21  0:32 kees at outflux dot net
  2022-05-21  0:33 ` [Bug c/105679] " kees at outflux dot net
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: kees at outflux dot net @ 2022-05-21  0:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105679
           Summary: erroneous -Warray-bounds warning with sanitizer
           Product: gcc
           Version: 12.1.1
            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 53010
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53010&action=edit
test case minimized as much as possible

Some combination of things (likely triggered by -fsanitize=shift and an array
index being used with "<<" operator) is causing erroneous warnings about array
bounds accesses:

$ gcc -O2 -Warray-bounds -fno-strict-aliasing -fno-strict-overflow
-fsanitize=shift  -fsanitize-coverage=trace-pc -c -o /dev/null test.c
test.c: In function 'work.isra':
test.c:31:32: warning: array subscript 32 is above array bounds of 'struct
object[2]' [-Warray-bounds]
   31 |         entry = instance->array[irq];
      |                 ~~~~~~~~~~~~~~~^~~~~
test.c:19:23: note: while referencing 'array'
   19 |         struct object array[ELEMENTS];
      |                       ^~~~~

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

end of thread, other threads:[~2023-05-08 12:24 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-21  0:32 [Bug c/105679] New: erroneous -Warray-bounds warning with sanitizer kees at outflux dot net
2022-05-21  0:33 ` [Bug c/105679] " kees at outflux dot net
2022-05-21  1:02 ` [Bug tree-optimization/105679] " pinskia at gcc dot gnu.org
2022-05-23  6:50 ` [Bug tree-optimization/105679] [12/13 Regression] extra -Warray-bounds warning added with -fsanitize=shift due to jump threading rguenth at gcc dot gnu.org
2022-07-29  8:19 ` rguenth at gcc dot gnu.org
2022-07-29 10:06 ` cvs-commit at gcc dot gnu.org
2022-07-29 10:06 ` [Bug tree-optimization/105679] [12 " rguenth at gcc dot gnu.org
2022-07-30 23:50 ` kees at outflux dot net
2022-08-01  8:01 ` rguenth at gcc dot gnu.org
2022-08-02  6:35 ` rguenth at gcc dot gnu.org
2022-10-06 17:27 ` kees at outflux dot net
2022-10-07  6:57 ` rguenth at gcc dot gnu.org
2022-10-08  2:31 ` kees at outflux dot net
2023-05-08 12:24 ` rguenth at gcc dot gnu.org

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