This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Re: Mainline Regression in gcc.target/i386/pr32268.c
Jakub Jelinek wrote:
Please don't. The fix is to change soft-float/soft-fp.h a bit. Jakub, is
this change acceptable for glibc?
No. You should IMHO instead
#define CMPtype int __attribute__ ((mode (__libgcc_cmp_return__)))
in config/i386/sfp-machine.h.
There is nothing libc specific on having a default CMPtype definition.
Hm, this won't fly. But following will:
typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
#define CMPtype __gcc_CMPtype
Attached patch adds this construct to i386/sfp-machine.h and
rs6000/sfp-machine.h. It also changes test as Kaveh suggested.
2008-02-17 Uros Bizjak <ubizjak@gmail.com>
* config/i386/sfp-machine.h (__gcc_CPMtype): Rename from CMPtype.
(CMPtype): Define as __gcc_CMPtype.
* config/rs6000/sfp-machine.h (__gcc_CMPtype): New typedef.
(CMPtype): Define as __gcc_CMPtype.
testsuite/ChangeLog:
2008-02-17 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/pr32268.c (test_lt): Add noinline attribute.
(test_gt): Ditto.
The patch was tested on x86_64-pc-linux-gnu.
OK for mainline (patch needs rs6000 maintainer approval)?
Thanks,
Uros.
Index: config/i386/sfp-machine.h
===================================================================
--- config/i386/sfp-machine.h (revision 132376)
+++ config/i386/sfp-machine.h (working copy)
@@ -10,9 +10,9 @@
/* The type of the result of a floating point comparison. This must
match `__libgcc_cmp_return__' in GCC for the target. */
+typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
+#define CMPtype __gcc_CMPtype
-typedef int CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
-
#define _FP_MUL_MEAT_Q(R,X,Y) \
_FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
Index: config/rs6000/sfp-machine.h
===================================================================
--- config/rs6000/sfp-machine.h (revision 132376)
+++ config/rs6000/sfp-machine.h (working copy)
@@ -3,6 +3,11 @@
#define _FP_WS_TYPE signed long
#define _FP_I_TYPE long
+/* The type of the result of a floating point comparison. This must
+ match `__libgcc_cmp_return__' in GCC for the target. */
+typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
+#define CMPtype __gcc_CMPtype
+
#define _FP_MUL_MEAT_S(R,X,Y) \
_FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
#define _FP_MUL_MEAT_D(R,X,Y) \
Index: testsuite/gcc.target/i386/pr32268.c
===================================================================
--- testsuite/gcc.target/i386/pr32268.c (revision 132376)
+++ testsuite/gcc.target/i386/pr32268.c (working copy)
@@ -4,12 +4,14 @@
extern void abort(void);
-int test_lt(__float128 x, __float128 y)
+int __attribute__ ((__noinline__))
+test_lt(__float128 x, __float128 y)
{
return x < y;
}
-int test_gt (__float128 x, __float128 y)
+int __attribute__ ((__noinline__))
+test_gt (__float128 x, __float128 y)
{
return x > y;
}