This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/71433] [7 Regression] -Warray-bounds false positive with -O2
- From: "vincent-gcc at vinc17 dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Oct 2016 13:21:47 +0000
- Subject: [Bug tree-optimization/71433] [7 Regression] -Warray-bounds false positive with -O2
- Auto-submitted: auto-generated
- References: <bug-71433-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71433
--- Comment #5 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
Any news?
FYI, the provided test case no longer yields the warning with Debian's
gcc-snapshot/20161006-1 package, but the issue is still present when compiling
MPFR (get_d.c). Here's a corresponding simple test case:
int t[1];
int fct (int r, long e)
{
int d = 0;
if (r == 4)
r = 1;
if (e < -52)
d = r == 0 ? 1 : 2;
else
{
int i, n = 53;
if (__builtin_expect (e < 0, 0))
n += e;
for (i = 1 ; i < n / 64 + 1 ; i++)
t[i] = 0;
}
return d;
}
Surprisingly, if I replace "int t[1];" by "int t[2];", I no longer get the
warning.