This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A possible bug in parsing floating point numbers.


On Tue, Apr 02, 2002 at 01:29:21AM -0800, Kazu Hirata wrote:
> 
> The first patch breaks the build of the h8300 port during compilation
> of libgcc2.c.  With the second patch, the h8300 port builds again, but
> I get ".long 0" in an assembly output for any floating point constant.
> Since you seem to have done some cleanup/fix on the lexical analysis
> of floating point numbers, I am wondering if you could give me some
> insight into this problem.  Here is what's happening.

Please try this patch.

zw

===================================================================
Index: real.c
--- real.c	2002/03/23 01:10:33	1.65
+++ real.c	2002/04/03 19:50:13
@@ -249,39 +249,8 @@ typedef unsigned int UHItype __attribute
 #define NE 6
 #define MAXDECEXP 4932
 #define MINDECEXP -4956
-/* 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 ((const UEMUSHORT *) (r), (e));				\
-     else								\
-       {								\
-	 UEMUSHORT w[4];					\
-         memcpy (&w[3], ((const EMUSHORT *) r), sizeof (EMUSHORT));	\
-         memcpy (&w[2], ((const EMUSHORT *) r) + 1, sizeof (EMUSHORT));	\
-         memcpy (&w[1], ((const EMUSHORT *) r) + 2, sizeof (EMUSHORT));	\
-         memcpy (&w[0], ((const EMUSHORT *) r) + 3, 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), (UEMUSHORT *) (r));				\
-     else								\
-       {								\
-	 UEMUSHORT w[4];					\
-	 etoe53 ((e), w);						\
-         memcpy (((EMUSHORT *) r), &w[3], sizeof (EMUSHORT));		\
-         memcpy (((EMUSHORT *) r) + 1, &w[2], sizeof (EMUSHORT));	\
-         memcpy (((EMUSHORT *) r) + 2, &w[1], sizeof (EMUSHORT));	\
-         memcpy (((EMUSHORT *) r) + 3, &w[0], sizeof (EMUSHORT));	\
-       }								\
-   } while (0)
-
+#define GET_REAL(r,e) e53toe ((const UEMUSHORT *) (r), (e))
+#define PUT_REAL(e,r) etoe53 ((e), (UEMUSHORT *) (r))
 #endif /* not TFmode */
 #endif /* not XFmode */
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]