From owner-freebsd-current@FreeBSD.ORG Mon Jun 25 15:26:01 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 E83E316A41F; Mon, 25 Jun 2007 15:26:01 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 6880013C44C; Mon, 25 Jun 2007 15:26:01 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.1/8.14.1) with ESMTP id l5PFQ0Ef054189; Mon, 25 Jun 2007 19:26:00 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nagual.pp.ru; s=default; t=1182785160; bh=oihE3yhCrW0gWIdZ2hxaBUavy4qHWj+kquIyHWY KB2M=; l=1614; h=Received:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:User-Agent; b=bI0gyboNEQrN07xfFS2Q vwGugGjaikW+mjvG4KEz6OM2cAC5qGcbxfjVLcJmEuSUhYJtxA2AH/xXTveXspvX/A5 0JZU7zF0itFdLvZbNBrjm/e6UroiD+UNU2n+e0hKYYej5HyfzYf9xMOef+TRUrrkuFK 2EiL67AEHPgVIitBM= Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l5PFPxEp054188; Mon, 25 Jun 2007 19:25:59 +0400 (MSD) (envelope-from ache) Date: Mon, 25 Jun 2007 19:25:59 +0400 From: Andrey Chernov To: Ed Schouten Message-ID: <20070625152559.GA54055@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Ed Schouten , Alexander Kabaev , current@freebsd.org, kan@freebsd.org References: <20070625130913.GA50273@nagual.pp.ru> <20070625133951.GA51324@nagual.pp.ru> <8e5ef5f70706250659v48f64410wb5399985a571087e@mail.gmail.com> <20070625145627.GA53685@nagual.pp.ru> <20070625151508.GO27942@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: <20070625151508.GO27942@hoeg.nl> User-Agent: Mutt/1.5.15 (2007-04-06) Cc: kan@freebsd.org, current@freebsd.org 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:26:02 -0000 --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--