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]

[testsuite] Clear hardware capabilities for gcc.target/x86_64/abi/avx on Solaris 10+/x86


The latest patch 119961-07 for the Solaris 10/x86 assembler added AVX
support.  When I tried a bootstrap with it, I noticed that all
gcc.target/x86_64 AVX execution test were failing:

FAIL: gcc.target/x86_64/abi/avx/test_m256_returning.c execution,  -O1 

The reason is already well known: the executables are tagged to require
AVX hardware support, but the machine obviously doesn't have it:

ld.so.1: test_m256_returning.x0: fatal: hardware capability unsupported: 0x20000000  [ 0x20000000 ]

The solution is the same as in

	PATCH: Clear hardware capabilities from gcc.target/i386 executables with Sun ld
	http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00985.html

clear them via an apporpriate linker map if the linker used supports
that.  The following patch implements this and lets the failures go
away.  Ok for mainline?

Even with this patch, there are still a couple of failing AVX tests in
gcc.target/i386 which seem to be due to as not handling a couple of AVX
instructions.  I've filed a bug for that:

6979956	as doesn't understand some AVX instructions

	Rainer


2010-08-26  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.target/x86_64/abi/avx/abi-avx.exp: Link with
	gcc.target/i386/clearcap.map if supported.

diff -r 0cf77b5772bf gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp
--- a/gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp	Mon Aug 23 13:25:29 2010 +0200
+++ b/gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp	Thu Aug 26 18:26:25 2010 +0200
@@ -28,9 +28,20 @@
 }
 
 
+# If the linker used understands -M <mapfile>, pass it to clear hardware
+# capabilities set by the Sun assembler.
+set flags ""
+set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map"
+
+if [check_no_compiler_messages mapfile executable {
+	int main (void) { return 0; }
+  } $clearcap_ldflags ] {
+  set flags $clearcap_ldflags
+}
+
 torture-init
 set-torture-options $C_TORTURE_OPTIONS
-set additional_flags "-W -Wall -mavx"
+set additional_flags "-W -Wall -mavx $flags"
 
 foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] {
     if {[runtest_file_p $runtests $src]} {


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


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