Article View: gnu.gcc.bug
Article #45enquire 4.3 (GCC 2.3.1) generates some garbage bits in float.h
From: Paul Eggert
Date: Mon, 02 Nov 1992 22:08
Date: Mon, 02 Nov 1992 22:08
38 lines
2208 bytes
2208 bytes
enquire 4.3, as distributed with GCC 2.3.1, generates some garbage bits in
float.h (sparc, SunOS 4.1.2). This causes spurious failures in regression
tests. For example, I generated float.h twice and got the following spurious
difference report:
diff /reb0.1/sun4c-4.1.2/lib/gcc-lib/sparc-sun/2.3.1/include/float.h float.h
64c64
< #define LDBL_MIN (__extension__ ((union __convert_long_double) {0x100000, 0x0, 0x8000000, 0xf82b8000}).__convert_long_double_d)
---
> #define LDBL_MIN (__extension__ ((union __convert_long_double) {0x100000, 0x0, 0x8000000, 0xf8290000}).__convert_long_double_d)
70c70
< #define LDBL_MAX (__extension__ ((union __convert_long_double) {0x7fefffff, 0xffffffff, 0x8000000, 0xf82b8000}).__convert_long_double_d)
---
> #define LDBL_MAX (__extension__ ((union __convert_long_double) {0x7fefffff, 0xffffffff, 0x8000000, 0xf8290000}).__convert_long_double_d)
On a sparc, a long double is only two integers long, so the last two integers
of LDBL_MIN and LDBL_MAX are garbage.
Here is a patch.
===================================================================
RCS file: RCS/enquire.c,v
retrieving revision 4.3
retrieving revision 4.3.1.1
diff -c -r4.3 -r4.3.1.1
*** enquire.c 1992/07/31 06:29:07 4.3
--- enquire.c 1992/11/02 21:49:19 4.3.1.1
***************
*** 906,911 ****
--- 906,912 ----
char *fake_f_rep(type, val) char *type; Long_double val; {
static char buf[1024];
union { int i[4]; Long_double ld;} u;
+ u.i[0] = u.i[1] = u.i[2] = u.i[3] = 0;
u.ld = val;
sprintf(buf, "(__extension__ ((union __convert_long_double) {0x%x, 0x%x, 0x%x, 0x%x}).__convert_long_double_d)",
u.i[0], u.i[1], u.i[2], u.i[3]);
Technical Details
Message-ID:
<9211022208.AA04283@farside.twinsun.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!portal!lll-winken!iggy.GW.Vitalink.COM!cs.widener.edu!umn.edu!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!twinsun.COM!eggertShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!portal!lll-winken!iggy.GW.Vitalink.COM!cs.widener.edu!umn.edu!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!twinsun.COM!eggert From: eggert@twinsun.COM (Paul Eggert) Newsgroups: gnu.gcc.bug Subject: enquire 4.3 (GCC 2.3.1) generates some garbage bits in float.h Message-ID: <9211022208.AA04283@farside.twinsun.com> Date: 2 Nov 92 22:08:31 GMT Sender: gnulists@ai.mit.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 38 Approved: bug-gcc@prep.ai.mit.edu