-Warray-bounds breaks bootstrap on i686-linux
François-Xavier Coudert
francois-xavier.coudert@lcp.u-psud.fr
Fri Jan 19 21:48:00 GMT 2007
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
More information about the Fortran
mailing list