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]

Restrict Power targets for gcc.dg/tree-ssa/loop-19.c


The test gcc.dg/tree-ssa/loop-19.c passes on Power with classic
hard-float or E500 double, but fails for soft-float or E500 single
because it depends on whether "double" operations are available.  (The
comment in the test says "The targets for this testcase are quite
limited, as with different set of available addressing modes, the
results may be quite different.".)  This patch adds a
powerpc_hard_double effective-target keyword to describe this
combination and makes this test use it.  OK to commit?

2008-06-11  Joseph Myers  <joseph@codesourcery.com>

	* lib/target-supports.exp
	(check_effective_target_powerpc_hard_double): New.
	* gcc.dg/tree-ssa/loop-19.c: Use powerpc_hard_double instead of
	powerpc*-*-*.

Index: gcc/testsuite/gcc.dg/tree-ssa/loop-19.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/loop-19.c	(revision 136681)
+++ gcc/testsuite/gcc.dg/tree-ssa/loop-19.c	(working copy)
@@ -4,7 +4,7 @@
  
    The testcase comes from PR 29256 (and originally, the stream benchmark).  */
 
-/* { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-*} } */
+/* { dg-do compile { target { i?86-*-* || { x86_64-*-* || powerpc_hard_double } } } } */
 /* { dg-require-effective-target nonpic } */
 /* { dg-options "-O3 -fdump-tree-final_cleanup" } */
 
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 136681)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -1266,6 +1266,24 @@
     }
 }
 
+# Return 1 if this is a PowerPC target with hardware double-precision
+# floating point.
+
+proc check_effective_target_powerpc_hard_double { } {
+    if { [istarget powerpc*-*-*]
+	 || [istarget rs6000-*-*] } {
+	return [check_no_compiler_messages powerpc_hard_double object {
+	    #ifdef _SOFT_DOUBLE
+	    #error soft double
+	    #else
+	    int dummy;
+	    #endif
+	}]
+    } else {
+	return 0
+    }
+}
+
 # Return 1 if this is a PowerPC target supporting -maltivec.
 
 proc check_effective_target_powerpc_altivec_ok { } {

-- 
Joseph S. Myers
joseph@codesourcery.com


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