This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: fix testsuite failure on sh* targets in builtin-ldexp-1.c
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: kkojima at rr dot iij4u dot or dot jp
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 21 Feb 2007 10:31:31 -0500 (EST)
- Subject: [PATCH]: fix testsuite failure on sh* targets in builtin-ldexp-1.c
Hi Kaz,
I noticed that in this posting:
http://gcc.gnu.org/ml/gcc-testresults/2007-02/msg00759.html
you're getting an error in gcc.dg/torture/builtin-ldexp-1.c which I
recently added. Does this patch to the testcase fix it for you? It's an
approach similar to what is used in gcc.dg/builtins-43.c (and 44, 45) for
tests using isnan() and/or isinf(). The sh target seems to imply
-ffinite-math-only which breaks any test using these functions because
the builtin folds all calls to zero in that case.
If it works, please let me know and I'll installed it.
Thanks,
--Kaveh
2007-02-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-ldexp-1.c: Use -fno-finite-math-only on
sh* targets. Call the correct CKSGN macro.
diff -rup orig/egcc-SVN20070220/gcc/testsuite/gcc.dg/torture/builtin-ldexp-1.c egcc-SVN20070220/gcc/testsuite/gcc.dg/torture/builtin-ldexp-1.c
--- orig/egcc-SVN20070220/gcc/testsuite/gcc.dg/torture/builtin-ldexp-1.c 2007-02-18 19:29:51.000000000 -0500
+++ egcc-SVN20070220/gcc/testsuite/gcc.dg/torture/builtin-ldexp-1.c 2007-02-21 09:55:07.757773691 -0500
@@ -6,6 +6,7 @@
Origin: Kaveh R. Ghazi, February 17, 2007. */
/* { dg-do link } */
+/* { dg-options "-fno-finite-math-only" { target sh*-*-* } } */
extern void link_error(int);
@@ -21,13 +22,13 @@ extern void link_error(int);
/* Test that FUNC(ARG1,ARG2) == RES. Check the sign for -0.0. */
#define TESTIT(FUNC,ARG1,ARG2,RES) do { \
if (__builtin_##FUNC##f(ARG1##f,ARG2) != RES##f \
- || CKSGN(__builtin_##FUNC##f(ARG1##f,ARG2),RES##f)) \
+ || CKSGN_F(__builtin_##FUNC##f(ARG1##f,ARG2),RES##f)) \
link_error(__LINE__); \
if (__builtin_##FUNC(ARG1,ARG2) != RES \
|| CKSGN(__builtin_##FUNC(ARG1,ARG2),RES)) \
link_error(__LINE__); \
if (__builtin_##FUNC##l(ARG1##l,ARG2) != RES##l \
- || CKSGN(__builtin_##FUNC##l(ARG1##l,ARG2),RES##l)) \
+ || CKSGN_L(__builtin_##FUNC##l(ARG1##l,ARG2),RES##l)) \
link_error(__LINE__); \
} while (0)
@@ -46,13 +47,13 @@ extern void link_error(int);
the sign as well. */
#define TESTIT3(FUNC,NEG,FUNCARG,ARGARG,ARG2,FUNCRES) do { \
if (!__builtin_##FUNCRES##f(__builtin_##FUNC##f(NEG __builtin_##FUNCARG##f(ARGARG),ARG2)) \
- || CKSGN(__builtin_##FUNC##f(NEG __builtin_##FUNCARG##f(ARGARG),ARG2), NEG __builtin_##FUNCARG##f(ARGARG))) \
+ || CKSGN_F(__builtin_##FUNC##f(NEG __builtin_##FUNCARG##f(ARGARG),ARG2), NEG __builtin_##FUNCARG##f(ARGARG))) \
link_error(__LINE__); \
if (!__builtin_##FUNCRES(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG),ARG2)) \
|| CKSGN(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG),ARG2), NEG __builtin_##FUNCARG(ARGARG))) \
link_error(__LINE__); \
if (!__builtin_##FUNCRES##l(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG),ARG2)) \
- || CKSGN(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG),ARG2), NEG __builtin_##FUNCARG##l(ARGARG))) \
+ || CKSGN_L(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG),ARG2), NEG __builtin_##FUNCARG##l(ARGARG))) \
link_error(__LINE__); \
} while (0)