[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [m68k] Toolchain regression in mathinline.h (glibc)



Stephen R Marenka <stephen@marenka.net> writes:

> On Sat, Feb 25, 2006 at 11:36:53PM +0000, Roger Leigh wrote:
>  
>> --- m68kmath/mathinline.h	2006-02-21 18:26:28.000000000 +0000
>> +++ mathinline.h	2006-02-25 23:30:48.000000000 +0000
>> @@ -100,7 +100,7 @@
>>  /* Define a const math function.  */
>>  #define __m81_defun(rettype, func, args)				      \
>>    __m81_inline rettype __attribute__((__const__))			      \
>> -  __m81_u(func) args
>> +  __m81_u(func) args __THROW
>
> No joy.
[...]
> I'll get around to figuring this out eventually, but I'm chasing gcc
> bugs at the moment. I'd appreciate it if someone out there could figure
> this thing out before then. :)

I've found a fix.  The attached patch is the changes in
<bits/mathinline.h> between sarge and current sid.  If you revert the
patch in sid, it builds just fine.   (Note the patch also reverts some
macro definitions around # if __GNUC_PREREQ (3,1); these are probably
unrelated.)

If you look at the patch, you'll see this is due to the removal of the
__THROW macros in 15 different places.  In many places, this could
probably be fixed by adding __THROW to the expansion of __m81_defun,
__inline_forward, and __inline_forward_c, but I'm not expert enough to
say for sure.

Quite why the __THROW macros were removed in the first place is not
clear.


Regards,
Roger

-- 
Roger Leigh
                Printing on GNU/Linux?  http://gutenprint.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
--- /usr/include/bits/mathinline.h	2005-05-12 15:12:12.000000000 +0200
+++ /org/chroots/user/sid/usr/include/bits/mathinline.h	2006-03-03 15:22:14.000000000 +0100
@@ -1,5 +1,5 @@
 /* Definitions of inline math functions implemented by the m68881/2.
-   Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003
+   Copyright (C) 1991,92,93,94,96,97,98,99,2000,2002, 2003, 2004
      Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -21,20 +21,18 @@
 #ifdef	__GNUC__
 
 #ifdef __USE_ISOC99
-
-# if __GNUC_PREREQ (3,1)
 /* GCC 3.1 and up have builtins that actually can be used.  */
-#  define isgreater(x, y) __builtin_isgreater (x, y)
-#  define isgreaterequal(x, y) __builtin_isgreaterequal (x, y)
-#  define isless(x, y) __builtin_isless (x, y)
-#  define islessequal(x, y) __builtin_islessequal (x, y)
-#  define islessgreater(x, y) __builtin_islessgreater (x, y)
-#  define isunordered(x, y) __builtin_isunordered (x, y)
-# else
+# if !__GNUC_PREREQ (3,1)
 /* ISO C99 defines some macros to perform unordered comparisons.  The
    m68k FPU supports this with special opcodes and we should use them.
    These must not be inline functions since we have to be able to handle
    all floating-point types.  */
+#  undef isgreater
+#  undef isgreaterequal
+#  undef isless
+#  undef islessequal
+#  undef islessgreater
+#  undef isunordered
 #  define isgreater(x, y)					\
    __extension__					\
    ({ char __result;					\
@@ -112,7 +110,7 @@
 #if defined __USE_MISC || defined __USE_ISOC99
 # define __inline_mathop(func, op)			\
   __inline_mathop1(double, func, op)			\
-  __inline_mathop1(float, __CONCAT(func,f), op)		\
+  __inline_mathop1(float, __CONCAT(func,f), op)	\
   __inline_mathop1(long double, __CONCAT(func,l), op)
 #else
 # define __inline_mathop(func, op)			\
@@ -120,7 +118,7 @@
 #endif
 
 #define __inline_mathop1(float_type,func, op)				      \
-  __m81_defun (float_type, func, (float_type __mathop_x)) __THROW	      \
+  __m81_defun (float_type, func, (float_type __mathop_x))		      \
   {									      \
     float_type __result;						      \
     __asm("f" __STRING(op) "%.x %1, %0" : "=f" (__result) : "f" (__mathop_x));\
@@ -177,7 +175,7 @@
    for the function names.  */
 
 #define __inline_functions(float_type, s)				  \
-__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x))	__THROW	  \
+__m81_defun (float_type, __CONCAT(__floor,s), (float_type __x))	  \
 {									  \
   float_type __result;							  \
   unsigned long int __ctrl_reg;						  \
@@ -193,7 +191,7 @@
   return __result;							  \
 }									  \
 									  \
-__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x)) __THROW	  \
+__m81_defun (float_type, __CONCAT(__ceil,s), (float_type __x))	  	  \
 {									  \
   float_type __result;							  \
   unsigned long int __ctrl_reg;						  \
@@ -219,7 +217,7 @@
 #ifdef __USE_MISC
 
 # define __inline_functions(float_type, s)				  \
-__m81_defun (int, __CONCAT(__isinf,s), (float_type __value)) __THROW	  \
+__m81_defun (int, __CONCAT(__isinf,s), (float_type __value))	  	  \
 {									  \
   /* There is no branch-condition for infinity,				  \
      so we must extract and examine the condition codes manually.  */	  \
@@ -229,7 +227,7 @@
   return (__fpsr & (2 << 24)) ? (__fpsr & (8 << 24) ? -1 : 1) : 0;	  \
 }									  \
 									  \
-__m81_defun (int, __CONCAT(__finite,s), (float_type __value)) __THROW	  \
+__m81_defun (int, __CONCAT(__finite,s), (float_type __value))	  	  \
 {									  \
   /* There is no branch-condition for infinity, so we must extract and	  \
      examine the condition codes manually.  */				  \
@@ -240,7 +238,7 @@
 }									  \
 									  \
 __m81_defun (float_type, __CONCAT(__scalbn,s),				  \
-	     (float_type __x, int __n))	__THROW				  \
+	     (float_type __x, int __n))					  \
 {									  \
   float_type __result;							  \
   __asm ("fscale%.l %1, %0" : "=f" (__result) : "dmi" (__n), "0" (__x));  \
@@ -257,7 +255,7 @@
 #if defined __USE_MISC || defined __USE_XOPEN
 
 # define __inline_functions(float_type, s)				  \
-__m81_defun (int, __CONCAT(__isnan,s), (float_type __value)) __THROW	  \
+__m81_defun (int, __CONCAT(__isnan,s), (float_type __value))	  	  \
 {									  \
   char __result;							  \
   __asm("ftst%.x %1\n"							  \
@@ -277,7 +275,7 @@
 #ifdef __USE_ISOC99
 
 # define __inline_functions(float_type, s)				  \
-__m81_defun (int, __CONCAT(__signbit,s), (float_type __value)) __THROW	  \
+__m81_defun (int, __CONCAT(__signbit,s), (float_type __value))	  	  \
 {									  \
   /* There is no branch-condition for the sign bit, so we must extract	  \
      and examine the condition codes manually.  */			  \
@@ -287,13 +285,13 @@
   return (__fpsr >> 27) & 1;						  \
 }									  \
 									  \
-__m81_defun (float_type, __CONCAT(__scalbln,s),				  \
-	     (float_type __x, long int __n)) __THROW			  \
+  __m81_defun (float_type, __CONCAT(__scalbln,s),			  \
+	     (float_type __x, long int __n))				  \
 {									  \
   return __CONCAT(__scalbn,s) (__x, __n);				  \
 }									  \
 									  \
-__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x)) __THROW \
+__m81_defun (float_type, __CONCAT(__nearbyint,s), (float_type __x))	  \
 {									  \
   float_type __result;							  \
   unsigned long int __ctrl_reg;						  \
@@ -307,7 +305,7 @@
   return __result;							  \
 }									  \
 									  \
-__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x)) __THROW	  \
+__m81_defun (long int, __CONCAT(__lrint,s), (float_type __x))		  \
 {									  \
   long int __result;							  \
   __asm ("fmove%.l %1, %0" : "=dm" (__result) : "f" (__x));		  \
@@ -316,7 +314,7 @@
 									  \
 __m81_inline float_type							  \
 __m81_u(__CONCAT(__fma,s))(float_type __x, float_type __y,		  \
-			   float_type __z) __THROW			  \
+			   float_type __z)				  \
 {									  \
   return (__x * __y) + __z;						  \
 }
@@ -333,7 +331,7 @@
 # define __inline_functions(float_type, s)				\
 __m81_inline void							\
 __m81_u(__CONCAT(__sincos,s))(float_type __x, float_type *__sinx,	\
-			      float_type *__cosx) __THROW		\
+			      float_type *__cosx)			\
 {									\
   __asm ("fsincos%.x %2,%1:%0"						\
 	 : "=f" (*__sinx), "=f" (*__cosx) : "f" (__x));			\
@@ -353,14 +351,14 @@
 /* Note that there must be no whitespace before the argument passed for
    NAME, to make token pasting work correctly with -traditional.  */
 # define __inline_forward_c(rettype, name, args1, args2)	\
-extern __inline rettype __attribute__((__const__))	\
-name args1 __THROW					\
-{							\
-  return __CONCAT(__,name) args2;			\
+extern __inline rettype __attribute__((__const__))		\
+  name args1							\
+{								\
+  return __CONCAT(__,name) args2;				\
 }
 
 # define __inline_forward(rettype, name, args1, args2)	\
-extern __inline rettype name args1 __THROW		\
+extern __inline rettype name args1			\
 {							\
   return __CONCAT(__,name) args2;			\
 }

Attachment: pgpDGquKLslCi.pgp
Description: PGP signature


Reply to: