[Bug tree-optimization/82596] missing -Warray-bounds on an out-of-bounds index into string literal

2017-10-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82596

Martin Sebor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Martin Sebor  ---
r253902 fixes one part of the problem involving string literals.  The other
part (the missing -Warray-bounds on (i < 0 ? ABC : DEF)[7]) is also subject to
pr82612 and will be fixed under that bug.

[Bug tree-optimization/82596] missing -Warray-bounds on an out-of-bounds index into string literal

2017-10-19 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82596

--- Comment #3 from Martin Sebor  ---
Author: msebor
Date: Thu Oct 19 16:03:07 2017
New Revision: 253902

URL: https://gcc.gnu.org/viewcvs?rev=253902=gcc=rev
Log:
PR tree-optimization/82596 - missing -Warray-bounds on an out-of-bounds
  index into string literal

gcc/ChangeLog:
* tree.c (array_at_struct_end_p): Handle STRING_CST.

gcc/testsuite/ChangeLog:
* gcc/testsuite/gcc.dg/pr82596.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/pr82596.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.c

[Bug tree-optimization/82596] missing -Warray-bounds on an out-of-bounds index into string literal

2017-10-17 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82596

Martin Sebor  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #2 from Martin Sebor  ---
Patch: https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01122.html

[Bug tree-optimization/82596] missing -Warray-bounds on an out-of-bounds index into string literal

2017-10-17 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82596

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-10-18
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
I'm testing a patch for this and a couple of the other -Warray-bounds bugs I
reported today (pr82588 and pr82583).