From: Volker Barthelmann <volker@vb.franken.de>
Subject: Re: axp/gcc the double cast gets trashed on return ( really a GDB BUG )
Date: =?ISO-8859-1?Q?Tue=2C_7_Oct_1997_22=3A19=3A58_+0200_=28xy=92U?= [thread overview]
Message-ID: <69984b38f4ce67c8d69c244d94fafe3b.axp-list@archive.invalid> (raw)
In-Reply-To: <343A30B1.CD60EA8F@voicenet.com>
On Tue, 7 Oct 1997, Uncle George wrote:
> > The code is basically broken. Reading another member of a union than the
> > one which was last written causes implementation defined behaviour (IMHO
> > it should even be undefined behaviour).
>
> This is not a broken feature, but rather a porting implimentation problem. The
> long on alpha is 64 bit, the double on a alpha is 64 bit. a union would make the
> space ONE. in reality quite a few people do this for the exact same reasons, so
> long as u understand how things are getting stored ( including packed/unpacked
> structs!)
It is not enough to know the exact representation of the data-types. You
are depending on how some things work inside the compiler. There are
compilers which will break such code no matter how the data is stored.
gcc may not do this, but gcc is extremely conservative in handling
aliasing. Compilers with more aggressive optimizers or even a future
version of gcc might break such code.
Volker
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next parent reply other threads:[~1997-10-07 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <343A30B1.CD60EA8F@voicenet.com>
1997-10-07 12:33 ` Volker Barthelmann [this message]
1997-10-07 12:53 axp/gcc the double cast gets trashed on return ( really a GDB BUG ) Uncle George
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