This is the mail archive of the gcc-patches@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]

Patch to allow real.c to compile on c4x, i370 & vax targets


Currently all c4x, i370 & vax targets cannot compile real.c.  I get
the following hard error (or something similar) in all cases:

 > real.c: In function `e113toe':
 > real.c:3325: error: `ieee_113' undeclared (first use in this function)
 > real.c:3325: error: (Each undeclared identifier is reported only once
 > real.c:3325: error: for each function it appears in.)
 > real.c: In function `etoe113':
 > real.c:3480: error: `ieee_113' undeclared (first use in this function)
 > real.c: In function `toe113':
 > real.c:3490: error: `ieee_113' undeclared (first use in this function)
 > real.c: In function `etoe64':
 > real.c:3502: error: `ieee_64' undeclared (first use in this function)
 > real.c: In function `toe64':
 > real.c:3512: error: `ieee_64' undeclared (first use in this function)
 > real.c: At top level:
 > real.c:398: warning: `dec_h' defined but not used
 > make: *** [real.o] Error 1

This patch allows real.c to compile without any warnings on the
following cross-targets which I believe tests all the various float
format combinations.

c4x-unknown-elf (C4X)
sparc-sun-solaris2.7 (IEEE)
i386-apple-darwin (Extended IEEE)
ia64-unknown-elf (Extended IEEE)
i370-unknown-linux-gnu (IBM)
vax-unknown-elf (DEC)

Ok to install?

		Thanks,
		--Kaveh


2002-08-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* real.c (ieee_64): Always define.
	(ieee_113): Guard with INTEL_EXTENDED_IEEE_FORMAT == 0.
	(dec_h): Not used yet, hide it.
	(emdnorm): Mark parameter in ATTRIBUTE_UNUSED.  Guard label with
	macro controlling use.
	(TFbignan, TFlittlenan): Guard with INTEL_EXTENDED_IEEE_FORMAT == 0.

diff -rup orig/egcc-CVS20020811/gcc/real.c egcc-CVS20020811/gcc/real.c
--- orig/egcc-CVS20020811/gcc/real.c	Mon Jul 29 22:03:35 2002
+++ egcc-CVS20020811/gcc/real.c	Sun Aug 11 22:44:48 2002
@@ -342,6 +342,8 @@ static const struct ieee_format ieee_53 
   EXONE - 0x3ff
 };
 
+#endif /* IEEE */
+
 /* IEEE extended double (64 bits).  */
 static const struct ieee_format ieee_64 =
 {
@@ -352,6 +354,7 @@ static const struct ieee_format ieee_64 
   0
 };
 
+#if (INTEL_EXTENDED_IEEE_FORMAT == 0)
 /* IEEE long double (113 bits).  */
 static const struct ieee_format ieee_113 =
 {
@@ -361,7 +364,7 @@ static const struct ieee_format ieee_113
   TFmode,
   0
 };
-#endif
+#endif /* INTEL_EXTENDED_IEEE_FORMAT == 0 */
 
 #ifdef DEC
 /* DEC F float (24 bits).  */
@@ -394,6 +397,7 @@ static const struct ieee_format dec_g =
   EXONE - 1025
 };
 
+#if 0
 /* DEC H float (113 bits).  (not yet used) */
 static const struct ieee_format dec_h =
 {
@@ -404,6 +408,7 @@ static const struct ieee_format dec_h =
   EXONE - 16385
 };
 #endif
+#endif /* DEC */
 
 extern int extra_warnings;
 extern const UEMUSHORT ezero[NE], ehalf[NE], eone[NE], etwo[NE];
@@ -2594,7 +2599,7 @@ static void
 emdnorm (s, lost, subflg, exp, rcntrl)
      UEMUSHORT s[];
      int lost;
-     int subflg;
+     int subflg ATTRIBUTE_UNUSED;
      EMULONG exp;
      int rcntrl;
 {
@@ -2753,7 +2758,9 @@ emdnorm (s, lost, subflg, exp, rcntrl)
 #endif
       eaddm (rbit, s);
     }
+#ifndef C4X
  mddone:
+#endif
 /* Undo the temporary shift for denormal values.  */
   if ((exp <= 0) && (rndprc != NBITS)
       && ((rndprc != 64) || ((rndprc == 64) && ! REAL_WORDS_BIG_ENDIAN)))
@@ -5961,7 +5968,7 @@ toc4x (x, y, mode)
 #ifdef TFMODE_NAN
 TFMODE_NAN;
 #else
-#ifdef IEEE
+#if defined (IEEE) && (INTEL_EXTENDED_IEEE_FORMAT == 0)
 static const UEMUSHORT TFbignan[8] =
  {0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff};
 static const UEMUSHORT TFlittlenan[8] = {0, 0, 0, 0, 0, 0, 0x8000, 0xffff};


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