public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/94675] New: [9 regression] -Warray-bounds false positive with -O2
@ 2020-04-20 19:42 chantry.xavier at gmail dot com
  2020-04-20 22:16 ` [Bug tree-optimization/94675] " msebor at gcc dot gnu.org
                   ` (27 more replies)
  0 siblings, 28 replies; 29+ messages in thread
From: chantry.xavier at gmail dot com @ 2020-04-20 19:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94675
           Summary: [9 regression] -Warray-bounds false positive with -O2
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chantry.xavier at gmail dot com
  Target Milestone: ---

Created attachment 48319
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48319&action=edit
test case

Tested with gcc 9.1 9.2 and 9.3 on godbolt.

Compiling with "-O2 -Warray-bounds" gives the following false positive :

---
<source>: In function 'f':
<source>:38:11: warning: array subscript 7 is outside array bounds of 'byte[1]'
{aka 'unsigned char[1]'} [-Warray-bounds]
   38 |     ps->s += len;
      |           ^~
<source>:46:6: note: while referencing 'c'

   46 | byte c;
      |      ^
Compiler returned: 0
---

Error also with -O3 but not with -O.

Note that the error goes after removing the assert.

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

end of thread, other threads:[~2023-07-07 10:37 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 19:42 [Bug tree-optimization/94675] New: [9 regression] -Warray-bounds false positive with -O2 chantry.xavier at gmail dot com
2020-04-20 22:16 ` [Bug tree-optimization/94675] " msebor at gcc dot gnu.org
2020-04-21  6:51 ` chantry.xavier at gmail dot com
2020-04-21  7:04 ` marxin at gcc dot gnu.org
2020-04-21  7:46 ` rguenth at gcc dot gnu.org
2020-04-21  7:58 ` [Bug tree-optimization/94675] [9/10 " rguenth at gcc dot gnu.org
2020-04-21  7:59 ` jakub at gcc dot gnu.org
2020-04-21  8:06 ` [Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948 jakub at gcc dot gnu.org
2020-04-21 14:03 ` law at redhat dot com
2020-04-21 14:18 ` rguenther at suse dot de
2020-04-21 14:43 ` law at redhat dot com
2020-04-21 14:57 ` rguenther at suse dot de
2020-04-21 14:58 ` msebor at gcc dot gnu.org
2020-04-21 19:14 ` law at redhat dot com
2020-04-21 19:16 ` law at redhat dot com
2020-04-21 20:10 ` law at redhat dot com
2020-04-21 21:00 ` msebor at gcc dot gnu.org
2020-04-22  6:34 ` rguenther at suse dot de
2020-04-24  7:48 ` chantry.xavier at gmail dot com
2020-04-24 15:16 ` msebor at gcc dot gnu.org
2020-04-30 13:12 ` chantry.xavier at gmail dot com
2021-06-01  8:17 ` [Bug tree-optimization/94675] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-09-06 11:25 ` pinskia at gcc dot gnu.org
2022-03-16 11:09 ` chantry.xavier at gmail dot com
2022-03-16 13:24 ` rguenth at gcc dot gnu.org
2022-05-27  9:42 ` [Bug tree-optimization/94675] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:40 ` jakub at gcc dot gnu.org
2023-05-14 21:25 ` [Bug tree-optimization/94675] [10/11/12/13/14 " pinskia at gcc dot gnu.org
2023-07-07 10:37 ` [Bug tree-optimization/94675] [11/12/13/14 " 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).