This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: aliasing nastiness
- To: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Subject: Re: aliasing nastiness
- From: Michael Vance <briareos at lokigames dot com>
- Date: Fri, 14 Jan 2000 15:25:01 -0800
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <387F78A7.E3B0BFFB@lokigames.com> <200001142145.WAA19564@loewis.home.cs.tu-berlin.de>
On Fri, Jan 14, 2000 at 10:45:14PM +0100, Martin v. Loewis wrote:
> > double tmp = *(double*)buffer;
> If you provide the same bytes in buffer on Linux/x86 and Win9x, you
> should get the same values. If you use Linux/Sparc, you'll get a
> different value due to endianness.
This is sortof true. VC generates a series of mov instructions to
literally move bytes into the value, while gcc appears to use the
floating point instructions to load/store the value.
Initially we thought there was a problem in this instruction, but it
appears that there is actually a problem in fprintf() for the two
platforms, related to rounding issues, as the binary information in
the double appears to be exact for both.
The different instruction generation is puzzling, though.
m.
--
Programmer "I wrote a song about dental floss,
Loki Entertainment Software but did anyone's teeth get cleaner?"
http://lokigames.com/~briareos/ - Frank Zappa, re: the PMRC