This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/32546] [4.3 Regression] 'warning: array subscript is above/below array bounds' on delete[]
- From: "p dot vanhoof at oma dot be" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Nov 2007 18:17:47 -0000
- Subject: [Bug middle-end/32546] [4.3 Regression] 'warning: array subscript is above/below array bounds' on delete[]
- References: <bug-32546-14599@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from p dot vanhoof at oma dot be 2007-11-18 18:17 -------
I am not completely sure whether this is the same underlying problem, but I get
a bogus warning "array subscript is above array bounds" with the code snippet
below when compiled with gcc -c -O3 -Wall:
=================
#define N 10
extern long H[N];
long m()
{
if( H[N-1] > 1 )
{
int i;
for( i=0; i < N-1; ++i )
if( H[i+1] > 1 )
break;
return H[i+1];
}
return 0;
}
=================
Note that the first if-statement guarantees that the break statement is always
executed and hence an out-of-bounds access is impossible. This is with gcc
4.3.0 20071116. This gcc version still reproduces the problem posted in comment
#4 as well.
--
p dot vanhoof at oma dot be changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |p dot vanhoof at oma dot be
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32546