Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: jeff.sturm@appnet.com
To: axp-list@redhat.com
Subject: Re: gcc 2.96 optimization bug on RedHat7.0/alpha
Date: Wed, 18 Apr 2001 14:38:47 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0104181353200.28470-100000@neoavalon.sigma6.com> (raw)
In-Reply-To: <3ADDCA70.ACA7A70C@voicenet.com>

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... <sigh>.)

--
Jeff Sturm
jeff.sturm@commerceone.com




  parent reply	other threads:[~2001-04-18 18:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-18  1:46 gcc 2.96 optimization bug on RedHat7.0/alpha Uncle George
2001-04-18  0:04 ` Christopher C. Chimelis
2001-04-18  3:41 ` Matt Wilson
2001-04-18  4:32 ` Brad Lucier
2001-04-18 15:13   ` Uncle George
2001-04-18 13:40     ` Pawel Salek
2001-04-18 15:53       ` Uncle George
2001-04-18 14:03     ` David Woodhouse
2001-04-18 17:10       ` Uncle George
2001-04-18 15:40         ` Pawel Salek
2001-04-18 16:17         ` David Woodhouse
2001-04-18 16:46         ` Andrew A. Gill
2001-04-18 17:04           ` T. Daniel Crawford
2001-04-18 18:15             ` Nelson Brito
2001-04-18 18:38         ` jeff.sturm [this message]
2001-04-18 14:55     ` Michal Jaegermann
2001-04-18 22:18       ` Uncle George
2001-04-18 20:50         ` Chris Eleveld (Sector 7 Group)
2001-04-18 21:33         ` Michal Jaegermann
2001-04-18 23:09           ` P.TURLAIS
2001-04-19  0:28           ` Uncle George
2001-04-18 22:03         ` jeff.sturm
  -- strict thread matches above, loose matches on Subject: below --
2001-04-18 16:22 Hoover, Tony
2001-04-18 16:55 ` David Woodhouse
2001-04-18 17:07 ` alvin
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox