This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/71433] [7 Regression] -Warray-bounds false positive with -O2


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]