Date: Mon, 25 Jun 2007 19:25:59 +0400 From: Andrey Chernov <ache@nagual.pp.ru> To: Ed Schouten <ed@fxq.nl> Cc: kan@freebsd.org, current@freebsd.org Subject: Re: Silent gcc 4.2.0 loop optimization bug with -O2 Message-ID: <20070625152559.GA54055@nagual.pp.ru> In-Reply-To: <20070625151508.GO27942@hoeg.nl> References: <20070625130913.GA50273@nagual.pp.ru> <20070625133951.GA51324@nagual.pp.ru> <8e5ef5f70706250659v48f64410wb5399985a571087e@mail.gmail.com> <20070625145627.GA53685@nagual.pp.ru> <20070625151508.GO27942@hoeg.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
--4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 25, 2007 at 05:15:08PM +0200, Ed Schouten wrote: > I did some more stripping and it turns out this is the problem >=20 > | int > | main(int argc, char *argv[]) > | { > | int i; > | int numbers[4] =3D { 0xdead, 0xbeef, 0x1337, 0x4242 }; > |=20 > | for (i =3D 1; i <=3D 12; i++) { > | if (i <=3D 4) > | printf("%d: %x\n", i, numbers[i-1]); > | else if (i >=3D 7 && i <=3D 9) > | printf("MUST BE HERE!!! %d\n", i); > | } > | } >=20 > When you increase the size of the array to 6 or higher, it does what you > want. It clearly looks like a compiler bug; the size of the array > shouldn't have an effect on the amount of iterations.=20 >=20 > You should really file a bug at GCC's to make sure this gets fixed in > 4.2.1. I am not familiar with gcc bugs reporting system at all. Could somebody=20 running 4.2.1 snapshot tells, is it already fixed, by chance? If no, could= =20 sumebody fill bug report to them or provide detailed instructions how to=20 do that, please? In any case, we must change default CFLAGS from -O2 -fno-strict-aliasing -pipe to -O -pipe for -current immediately. --=20 http://ache.pp.ru/ --4Ckj6UjgE2iN1+kY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFGf96HVg5YK5ZEdN0RAnb+AJ9p5T6EVk6R0CNLtRiFquuh+dz//gCgmx/q x/f1Kc3u4/Z1Xr7cz3BMyo0= =RncG -----END PGP SIGNATURE----- --4Ckj6UjgE2iN1+kY--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070625152559.GA54055>