Floating Pt. Optimize on PA
Mark Klein
mklein@dis.com
Fri Dec 25 17:46:00 GMT 1998
At 05:25 PM 12/25/98 -0700, Jeffrey A Law wrote:
>I didn't do the full analysis, but I'm pretty sure your sample code is bogus.
>
>#define SET_DOUBLE(_t, _addr, _v) \
> ( (_t).d = (_v), \
> ((long*)(_addr))[0] = ((long*) &(_t))[0], \
> ((long*)(_addr))[1] = ((long*) &(_t))[1])
>
>Note that you references the data in "t" via t.d and ((long*) (&_t)[0] which
>produces undefined results according to ANSI.
This is lifted directly from the java VM source. I realize that I could
build my own SET_DOUBLE and friends, but this is part of the shared
JVM code, so I don't want to change it if I don't have to. Since this problem
was pointed out by someone at JavaSoft, I'll forward your comments back to
them for review.
In the mean time, this worked with gcc 2.8.x and fails in egcs at O2.
--
Mark Klein DIS International, Ltd.
http://www.dis.com 415-892-8400
PGP Public Key Available
More information about the Gcc-bugs
mailing list