Commit d7afe8ec by Mark Mitchell Committed by Jeff Law

real.c (GET_REAL): Don't violate ANSI/ISO aliasing rules.


        * real.c (GET_REAL): Don't violate ANSI/ISO aliasing rules.
        (PUT_REAL): Likewise.

From-SVN: r28521
parent 67a60018
Wed Aug 4 23:39:20 1999 Mark Mitchell <mark@codesourcery.com>
* real.c (GET_REAL): Don't violate ANSI/ISO aliasing rules.
(PUT_REAL): Likewise.
Wed Aug 4 20:45:04 1999 J"orn Rennecke <amylaar@cygnus.co.uk> Wed Aug 4 20:45:04 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* final.c (shorten_branches): Don't add an alignment for loops * final.c (shorten_branches): Don't add an alignment for loops
......
...@@ -274,34 +274,34 @@ do { \ ...@@ -274,34 +274,34 @@ do { \
/* Emulator uses target format internally /* Emulator uses target format internally
but host stores it in host endian-ness. */ but host stores it in host endian-ness. */
#define GET_REAL(r,e) \ #define GET_REAL(r,e) \
do { \ do { \
if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \ if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \
e53toe ((unsigned EMUSHORT *) (r), (e)); \ e53toe ((unsigned EMUSHORT *) (r), (e)); \
else \ else \
{ \ { \
unsigned EMUSHORT w[4]; \ unsigned EMUSHORT w[4]; \
w[3] = ((EMUSHORT *) r)[0]; \ bcopy (((EMUSHORT *) r), &w[3], sizeof (EMUSHORT)); \
w[2] = ((EMUSHORT *) r)[1]; \ bcopy (((EMUSHORT *) r) + 1, &w[2], sizeof (EMUSHORT)); \
w[1] = ((EMUSHORT *) r)[2]; \ bcopy (((EMUSHORT *) r) + 2, &w[1], sizeof (EMUSHORT)); \
w[0] = ((EMUSHORT *) r)[3]; \ bcopy (((EMUSHORT *) r) + 3, &w[0], sizeof (EMUSHORT)); \
e53toe (w, (e)); \ e53toe (w, (e)); \
} \ } \
} while (0) } while (0)
#define PUT_REAL(e,r) \ #define PUT_REAL(e,r) \
do { \ do { \
if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \ if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \
etoe53 ((e), (unsigned EMUSHORT *) (r)); \ etoe53 ((e), (unsigned EMUSHORT *) (r)); \
else \ else \
{ \ { \
unsigned EMUSHORT w[4]; \ unsigned EMUSHORT w[4]; \
etoe53 ((e), w); \ etoe53 ((e), w); \
*((EMUSHORT *) r) = w[3]; \ bcopy (&w[3], ((EMUSHORT *) r), sizeof (EMUSHORT)); \
*((EMUSHORT *) r + 1) = w[2]; \ bcopy (&w[2], ((EMUSHORT *) r) + 1, sizeof (EMUSHORT)); \
*((EMUSHORT *) r + 2) = w[1]; \ bcopy (&w[1], ((EMUSHORT *) r) + 2, sizeof (EMUSHORT)); \
*((EMUSHORT *) r + 3) = w[0]; \ bcopy (&w[0], ((EMUSHORT *) r) + 3, sizeof (EMUSHORT)); \
} \ } \
} while (0) } while (0)
#else /* not REAL_ARITHMETIC */ #else /* not REAL_ARITHMETIC */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment