This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
-Warray-bounds breaks bootstrap on i686-linux
- From: François-Xavier Coudert <francois-xavier dot coudert at lcp dot u-psud dot fr>
- To: dmueller at suse dot de, Richard Guenther <rguenther at suse dot de>
- Cc: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 19 Jan 2007 22:02:21 +0100
- Subject: -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