[patch] fix check_effective_target_vect_long for powerpc64

Janis Johnson janis187@us.ibm.com
Tue Nov 30 21:35:00 GMT 2004


Test gcc.dg/vect/pr18425.c should only be run for targets that support
vectors of type long.  The check for this returns true for powerpc
targets, but it should be false when generating 64-bit code.  The check
should not cache the result because the value changes depending on
whether the test is run with -m32 or -m64.

Tested on powerpc64-unknown-linux-gnu with -m32 and -m64.  I'm checking
it in.

2004-11-30  Janis Johnson  <janis187@us.ibm.com>

	* lib/target-supports.exp (check_effective_target_vect_long):
	Fix for powerpc64-*-*.

Index: lib/target-supports.exp
===================================================================
RCS file: /opt/gcc-cvs/gcc/gcc/testsuite/lib/target-supports.exp,v
retrieving revision 1.29
diff -u -p -r1.29 target-supports.exp
--- lib/target-supports.exp	23 Nov 2004 22:03:31 -0000	1.29
+++ lib/target-supports.exp	30 Nov 2004 19:19:52 -0000
@@ -458,25 +458,20 @@ proc check_effective_target_vect_int { }
 
 # Return 1 if the target supports hardware vectors of long, 0 otherwise.
 #
-# This won't change for different subtargets so cache the result.
+# This can change for different subtargets so do not cache the result.
 
 proc check_effective_target_vect_long { } {
-    global et_vect_long_saved
-
-    if [info exists et_vect_long_saved] {
-	verbose "check_effective_target_vect_long: using cached result" 2
+    if { [istarget i?86-*-*]
+	 || ([istarget powerpc*-*-*] && [check_effective_target_ilp32])
+	 || [istarget x86_64-*-*]
+	 || ([istarget sparc*-*-*] && [check_effective_target_ilp32]) } {
+	set answer 1
     } else {
-	set et_vect_long_saved 0
-	if { [istarget i?86-*-*]
-	      || [istarget powerpc*-*-*]
-	      || [istarget x86_64-*-*]
-	      || ([istarget sparc*-*-*] && [check_effective_target_ilp32]) } {
-	   set et_vect_long_saved 1
-	}
+	set answer 0
     }
 
-    verbose "check_effective_target_vect_long: returning $et_vect_long_saved" 2
-    return $et_vect_long_saved
+    verbose "check_effective_target_vect_long: returning $answer" 2
+    return $answer
 }
 
 # Return 1 if the target supports hardware vectors of float, 0 otherwise.



More information about the Gcc-patches mailing list