This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: A possible bug in parsing floating point numbers.
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Kazu Hirata <kazu at hxi dot com>
- Cc: gcc-bugs at gcc dot gnu dot org, tm at mail dot kloo dot net
- Date: Wed, 3 Apr 2002 11:51:07 -0800
- Subject: Re: A possible bug in parsing floating point numbers.
- References: <E16sKbQ-0000sW-04@taltos.codesourcery.com>
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 */