From owner-freebsd-current@FreeBSD.ORG Mon Jun 25 15:15:09 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B571116A421 for ; Mon, 25 Jun 2007 15:15:09 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [83.98.131.211]) by mx1.freebsd.org (Postfix) with ESMTP id 79D4D13C447 for ; Mon, 25 Jun 2007 15:15:09 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 218EA1CC5A; Mon, 25 Jun 2007 17:15:08 +0200 (CEST) Date: Mon, 25 Jun 2007 17:15:08 +0200 From: Ed Schouten To: Andrey Chernov , Alexander Kabaev , current@freebsd.org, kan@freebsd.org Message-ID: <20070625151508.GO27942@hoeg.nl> References: <20070625130913.GA50273@nagual.pp.ru> <20070625133951.GA51324@nagual.pp.ru> <8e5ef5f70706250659v48f64410wb5399985a571087e@mail.gmail.com> <20070625145627.GA53685@nagual.pp.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbVrQm6YT89AsdIa" Content-Disposition: inline In-Reply-To: <20070625145627.GA53685@nagual.pp.ru> User-Agent: Mutt/1.5.15 (2007-04-06) Cc: Subject: Re: Silent gcc 4.2.0 loop optimization bug with -O2 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2007 15:15:09 -0000 --VbVrQm6YT89AsdIa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Andrey, * Andrey Chernov wrote: > Well... Is this small enough? I did some more stripping and it turns out this is the problem | 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); | } | } 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 You should really file a bug at GCC's to make sure this gets fixed in 4.2.1. Yours, --=20 Ed Schouten WWW: http://g-rave.nl/ --VbVrQm6YT89AsdIa Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGf9v852SDGA2eCwURAuLFAJ0Wr+Sy/MXmcMn1lcz4chAvRAUNuwCcDCYf DjshVg1xAtKEc0+nPzaJj0g= =/V/g -----END PGP SIGNATURE----- --VbVrQm6YT89AsdIa--