[Bug c/60121] gcc does not warn an obvious out-of-bound array access at -O0 and -O1

su at cs dot ucdavis.edu gcc-bugzilla@gcc.gnu.org
Sat Feb 8 23:16:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60121

--- Comment #1 from Zhendong Su <su at cs dot ucdavis.edu> ---
Here is the testcase: 


-------------------------


int a, b[1];

int
main ()
{
 lbl:
  for (; a; a--)
    if (b[613])
      goto lbl;

  return 0;
}



More information about the Gcc-bugs mailing list