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

#ifdef maze logic error in real.h

I keep reading real.h (trying to fix some warnings in a target I am
working on).  And for the life of me I cannot see how the #else part of
the 'software floating point emulator interface' "#ifdef REAL_ARITHMETIC"
can ever be true.

However, the code has been this way for a long time, so I keep wondering
if I am missing something.  With an appropriate ChangeLog, should this be

Index: real.h
RCS file: /FBSD/egcs-repo/Cvs/egcs/gcc/real.h,v
retrieving revision 1.33
diff -u -r1.33 real.h
--- real.h	11 Oct 2001 12:43:42 -0000	1.33
+++ real.h	8 Dec 2001 01:27:15 -0000
@@ -92,7 +92,6 @@
    has been defined to be 96 in the tm.h machine file.  */
 typedef struct {
   HOST_WIDE_INT r[(11 + sizeof (HOST_WIDE_INT))/(sizeof (HOST_WIDE_INT))];
 } realvaluetype;
@@ -103,7 +102,6 @@
 typedef struct {
   HOST_WIDE_INT r[(19 + sizeof (HOST_WIDE_INT))/(sizeof (HOST_WIDE_INT))];
 } realvaluetype;
@@ -135,7 +133,7 @@
    they invoke emulator functions. This will succeed only if the machine
    files have been updated to use these macros in place of any
    references to host machine `double' or `float' types.  */
 #define REAL_ARITHMETIC(value, code, d1, d2) \
   earith (&(value), (code), &(d1), &(d2))
@@ -238,34 +236,9 @@
 /* Conversions to decimal ASCII string.  */
 #define REAL_VALUE_TO_DECIMAL(r, fmt, s) (ereal_to_decimal (r, s))
-#endif /* REAL_ARITHMETIC defined */
 /* **** End of software floating point emulator interface macros **** */
-#else /* No XFmode or TFmode and REAL_ARITHMETIC not defined */
-/* old interface */
-/* Defining REAL_IS_NOT_DOUBLE breaks certain initializations
-   when REAL_ARITHMETIC etc. are not defined.  */
-/* Now see if the host and target machines use the same format. 
-   If not, define REAL_IS_NOT_DOUBLE (even if we end up representing
-   reals as doubles because we have no better way in this cross compiler.)
-   This turns off various optimizations that can happen when we know the
-   compiler's float format matches the target's float format.
-   */
-typedef struct {
-    HOST_WIDE_INT r[sizeof (double)/sizeof (HOST_WIDE_INT)];
-  } realvaluetype;
-#define REAL_VALUE_TYPE realvaluetype
-#endif /* no REAL_VALUE_TYPE */
-#endif /* formats differ */
-#endif /* 0 */
-#endif /* emulator not used */
+#endif /* REAL_ARITHMETIC defined -- emulator not used */
 /* If we are not cross-compiling, use a `double' to represent the
    floating-point value.  Otherwise, use some other type

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