Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Aug 2002 22:27:01 +0100
From:      David Malone <dwmalone@maths.tcd.ie>
To:        Dan Lukes <dan@obluda.cz>
Cc:        freebsd-bugs@FreeBSD.org, bde@FreeBSD.org
Subject:   Re: bin/40209: __dtoa broken with -O2 or -O3 optimisation
Message-ID:  <20020811212701.GA95745@walton.maths.tcd.ie>
In-Reply-To: <200207150140.g6F1e4SI056496@freefall.freebsd.org>
References:  <200207150140.g6F1e4SI056496@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 14, 2002 at 06:40:04PM -0700, Dan Lukes wrote:
>    226: #define word0(x) ((ULong *)&x)[1]
>    227: #define word1(x) ((ULong *)&x)[0]

I guess that changing x by accessing word0 or word1 is a violation
of the aliasing rules. The deinitions might work:

union doubleasulongs {
        double x;
        ULong w[2];
};

#define word0(x) (((union doubleasulongs *)&x)->w)[1]
#define word1(x) (((union doubleasulongs *)&x)->w)[0]

Could you test them and see?

	David.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020811212701.GA95745>