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 bootstrap/30511] False array bound check causes gcc failed to boostrap



------- Comment #3 from mrs at apple dot com  2007-01-19 22:02 -------
Testcase from delta, compile with:

$ ./xgcc -B./  t.c -O2 -S -Wall
t.c: In function 'gfc_get_namespace':
t.c:10: warning: array subscript is above array bounds


typedef struct { int kind; } gfc_typespec;
typedef struct gfc_namespace { gfc_typespec default_type[26]; } gfc_namespace;
void gfc_get_namespace ()
{
  gfc_namespace *ns=0;
  gfc_typespec *ts =0;
  int i;
  for (i = 'a'; i <= 'z'; i++)
    {
      ts = &ns->default_type[i - 'a'];
      ts->kind = 0;
    }
}


-- 


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


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