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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |10.0
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |msebor at gcc dot 
gnu.org
   Target Milestone|---                         |10.0
      Known to fail|                            |7.3.0, 8.3.0, 9.2.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC 10.0 (since r277728) issues the following warning:

$ gcc -O2 -S -Wall -fdump-tree-optimized=/dev/stdout pr88565.C
pr88565.C: In member function ‘int S::f()’:
pr88565.C:13:13: warning: array subscript 7 is above array bounds of ‘int [3]’
[-Warray-bounds]
   13 |   return a[7];   // request: issue -Warray-bounds=1
      |          ~~~^
pr88565.C:8:7: note: while referencing ‘S::a’
    8 |   int a[3];
      |       ^

;; Function S::f (_ZN1S1fEv, funcdef_no=0, decl_uid=2330, cgraph_uid=1,
symbol_order=0)

S::f (struct S * const this)
{
  int _3;

  <bb 2> [local count: 1073741824]:
  _3 = this_2(D)->a[7];
  return _3;

}

Reply via email to