diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-05 05:42:43 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-05 05:42:43 +0000 |
commit | 8009629d46b4f981afac044a6177d14f17362037 (patch) | |
tree | 36f95fa863b05010f3f84db4bf8a0ee89078148f | |
parent | 3f122cda9bf453df79367853301f87d96c5fe695 (diff) |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-2_95-branch@28522 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/real.c | 52 |
2 files changed, 31 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f18aab798b..0c2eccb588b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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 02:15:32 1999 Richard Henderson <rth@cygnus.com> * jump.c (delete_insn): Delete the addr_vec when deleting a tablejump. diff --git a/gcc/real.c b/gcc/real.c index 2d615757af1..a3fda6d4c91 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -269,34 +269,34 @@ do { \ /* Emulator uses target format internally but host stores it in host endian-ness. */ -#define GET_REAL(r,e) \ -do { \ - if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \ - e53toe ((unsigned EMUSHORT *) (r), (e)); \ - else \ - { \ - unsigned EMUSHORT w[4]; \ - w[3] = ((EMUSHORT *) r)[0]; \ - w[2] = ((EMUSHORT *) r)[1]; \ - w[1] = ((EMUSHORT *) r)[2]; \ - w[0] = ((EMUSHORT *) r)[3]; \ - e53toe (w, (e)); \ - } \ +#define GET_REAL(r,e) \ +do { \ + if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \ + e53toe ((unsigned EMUSHORT *) (r), (e)); \ + else \ + { \ + unsigned EMUSHORT w[4]; \ + bcopy (((EMUSHORT *) r), &w[3], sizeof (EMUSHORT)); \ + bcopy (((EMUSHORT *) r) + 1, &w[2], sizeof (EMUSHORT)); \ + bcopy (((EMUSHORT *) r) + 2, &w[1], sizeof (EMUSHORT)); \ + bcopy (((EMUSHORT *) r) + 3, &w[0], sizeof (EMUSHORT)); \ + e53toe (w, (e)); \ + } \ } while (0) -#define PUT_REAL(e,r) \ -do { \ - if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \ - etoe53 ((e), (unsigned EMUSHORT *) (r)); \ - else \ - { \ - unsigned EMUSHORT w[4]; \ - etoe53 ((e), w); \ - *((EMUSHORT *) r) = w[3]; \ - *((EMUSHORT *) r + 1) = w[2]; \ - *((EMUSHORT *) r + 2) = w[1]; \ - *((EMUSHORT *) r + 3) = w[0]; \ - } \ +#define PUT_REAL(e,r) \ +do { \ + if (HOST_FLOAT_WORDS_BIG_ENDIAN == REAL_WORDS_BIG_ENDIAN) \ + etoe53 ((e), (unsigned EMUSHORT *) (r)); \ + else \ + { \ + unsigned EMUSHORT w[4]; \ + etoe53 ((e), w); \ + bcopy (&w[3], ((EMUSHORT *) r), sizeof (EMUSHORT)); \ + bcopy (&w[2], ((EMUSHORT *) r) + 1, sizeof (EMUSHORT)); \ + bcopy (&w[1], ((EMUSHORT *) r) + 2, sizeof (EMUSHORT)); \ + bcopy (&w[0], ((EMUSHORT *) r) + 3, sizeof (EMUSHORT)); \ + } \ } while (0) #else /* not REAL_ARITHMETIC */ |