This is the mail archive of the gcc-patches@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]

-Warray-bounds breaks bootstrap on i686-linux


The Fortran front-end fails to build (breaking bootstrap) on i686- linux for revision 120949, due to the -Warray-bounds patch at -O2. I believe it to be legal:

$ cat a.i
typedef struct gfc_namespace
{
  int default_type[26];
}
gfc_namespace;

void gfc_get_namespace (gfc_namespace *ns)
{
  int i, *ts;

for (i = 'a'; i <= 'b'; i++)
{
ts = &ns->default_type[i - 'a'];
*ts = ns->default_type[0];
}
}
$ /home/fxcoudert/svn/debug3/ibin/./prev-gcc/xgcc -B/home/fxcoudert/ svn/debug3/ibin/./prev-gcc/ -B/home/fxcoudert/svn/debug3/irun/i686-pc- linux-gnu/bin/ -c -O2 -W -Wall a.i
a.i: In function ‘gfc_get_namespace’:
a.i:13: warning: array subscript is above array bounds



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