From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 74A1530A4E for ; Wed, 18 Apr 2001 14:21:22 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f3IIHtQ19806 for axp-list@listman.redhat.com; Wed, 18 Apr 2001 14:17:55 -0400 Received: from neoavalon.sigma6.com (neoavalon.sigma6.com [204.176.48.130]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f3IIHnC19772 for ; Wed, 18 Apr 2001 14:17:54 -0400 Received: from localhost (jsturm@localhost) by neoavalon.sigma6.com (8.9.3/8.9.3) with ESMTP id OAA30673 for ; Wed, 18 Apr 2001 14:38:47 -0400 From: jeff.sturm@appnet.com X-Authentication-Warning: neoavalon.sigma6.com: jsturm owned process doing -bs Date: Wed, 18 Apr 2001 14:38:47 -0400 (EDT) X-Sender: jsturm@neoavalon.sigma6.com To: axp-list@redhat.com Subject: Re: gcc 2.96 optimization bug on RedHat7.0/alpha In-Reply-To: <3ADDCA70.ACA7A70C@voicenet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: On Wed, 18 Apr 2001, Uncle George wrote: > It is never perfectly OK to produce bad code. AND i dont care what > standard one uses to justify this 'OK'ness. So what do you want to hear? That the behavior of your code is defined according to the standard? I don't have the relevant text handy but I'm pretty sure it isn't. If you want to know how to make your code work as before, Brad already said -fno-strict-aliasing gives you the old behavior (along with lesser optimization). FWIW I didn't realize -fstrict-aliasing was the default on Red Hat's compiler. With 2.95 you still had to specify -fstrict-alising if you wanted it. (Anybody try Uncle George's example on ccc, just for kicks?) Anyhow... all standards and correctness issues aside, one problem with that sort of pointer manipulation is that the compiler cannot generate optimal code (i.e. eliminate evil loads/stores). Your double argument starts in a register, then must be written to a temporary location from which the integers are read. That's a RAW conflict, and likely causes a replay trap. I don't know if EV6 has a better way, but you aren't going to see one as long as you are confusing the compiler by casting pointers. A union is the correct way to handle it. In principle, the compiler can optimize accesses to a union type by generating register->register ops when appropriate. (I proved this with an experiment on x86, since my alpha is 1000's of miles away and crippled by a power storm... .) -- Jeff Sturm jeff.sturm@commerceone.com