This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/59124] [5/6/7 Regression] Wrong warnings "array subscript is above array bounds"
- From: "szotsaki at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Aug 2016 12:25:47 +0000
- Subject: [Bug tree-optimization/59124] [5/6/7 Regression] Wrong warnings "array subscript is above array bounds"
- Auto-submitted: auto-generated
- References: <bug-59124-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124
Szőts Ákos <szotsaki at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |szotsaki at gmail dot com
--- Comment #41 from Szőts Ákos <szotsaki at gmail dot com> ---
A newer example:
int main() {
bool exists = true;
int i = 0;
int sum = 0;
volatile int array_size = 7;
volatile int array[7];
while (exists)
{
for (i = 0; i < array_size - 1; i++)
{
if (array[i] == 0) sum += array[i + 1];
exists = false;
}
}
return 0;
}
Can be reproduced both by v5.3.0 and v6.1.1 with "g++ -O3 -Wall main.cpp".