Fri Jan 21 23:36:50 2011 UTC ()
add may alias attribute to the double union because gcc-4.5.x produces
incorrect code on ARMv7a. From nikunj badjatya


(christos)
diff -r1.7 -r1.8 src/lib/libc/gdtoa/gdtoaimp.h

cvs diff -r1.7 -r1.8 src/lib/libc/gdtoa/gdtoaimp.h (expand / switch to unified diff)

--- src/lib/libc/gdtoa/gdtoaimp.h 2009/05/07 20:31:44 1.7
+++ src/lib/libc/gdtoa/gdtoaimp.h 2011/01/21 23:36:49 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: gdtoaimp.h,v 1.7 2009/05/07 20:31:44 christos Exp $ */ 1/* $NetBSD: gdtoaimp.h,v 1.8 2011/01/21 23:36:49 christos Exp $ */
2 2
3/**************************************************************** 3/****************************************************************
4 4
5The author of this software is David M. Gay. 5The author of this software is David M. Gay.
6 6
7Copyright (C) 1998-2000 by Lucent Technologies 7Copyright (C) 1998-2000 by Lucent Technologies
8All Rights Reserved 8All Rights Reserved
9 9
10Permission to use, copy, modify, and distribute this software and 10Permission to use, copy, modify, and distribute this software and
11its documentation for any purpose and without fee is hereby 11its documentation for any purpose and without fee is hereby
12granted, provided that the above copyright notice appear in all 12granted, provided that the above copyright notice appear in all
13copies and that both that the copyright notice and this 13copies and that both that the copyright notice and this
14permission notice and warranty disclaimer appear in supporting 14permission notice and warranty disclaimer appear in supporting
@@ -266,27 +266,27 @@ extern Char *MALLOC ANSI((size_t)); @@ -266,27 +266,27 @@ extern Char *MALLOC ANSI((size_t));
266#define n_bigtens 2 266#define n_bigtens 2
267#endif 267#endif
268 268
269#include "math.h" 269#include "math.h"
270 270
271#ifdef __cplusplus 271#ifdef __cplusplus
272extern "C" { 272extern "C" {
273#endif 273#endif
274 274
275#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + defined(IBM) != 1 275#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + defined(IBM) != 1
276Exactly one of IEEE_LITTLE_ENDIAN, IEEE_BIG_ENDIAN, VAX, or IBM should be defined. 276Exactly one of IEEE_LITTLE_ENDIAN, IEEE_BIG_ENDIAN, VAX, or IBM should be defined.
277#endif 277#endif
278 278
279typedef union { double d; ULong L[2]; } U; 279typedef union { double d; ULong L[2]; } __attribute__((__may_alias__)) U;
280 280
281#ifdef YES_ALIAS 281#ifdef YES_ALIAS
282#define dval(x) x 282#define dval(x) x
283#ifdef IEEE_LITTLE_ENDIAN 283#ifdef IEEE_LITTLE_ENDIAN
284#define word0(x) ((ULong *)&x)[1] 284#define word0(x) ((ULong *)&x)[1]
285#define word1(x) ((ULong *)&x)[0] 285#define word1(x) ((ULong *)&x)[0]
286#else 286#else
287#define word0(x) ((ULong *)&x)[0] 287#define word0(x) ((ULong *)&x)[0]
288#define word1(x) ((ULong *)&x)[1] 288#define word1(x) ((ULong *)&x)[1]
289#endif 289#endif
290#else /* !YES_ALIAS */ 290#else /* !YES_ALIAS */
291#ifdef IEEE_LITTLE_ENDIAN 291#ifdef IEEE_LITTLE_ENDIAN
292#define word0(x) ( /* LINTED */ (U*)&x)->L[1] 292#define word0(x) ( /* LINTED */ (U*)&x)->L[1]