Correct vect_cmdline_needed for x86 -m64

Joseph S. Myers joseph@codesourcery.com
Thu Oct 5 17:03:00 GMT 2006


On Wed, 4 Oct 2006, Janis Johnson wrote:

> No, more is needed here because the result is cached.  The comment above
> the proc says that the result won't change for different subtargets, but
> you're saying that the result is different for -m32 than for -m64.  See,
> for example, check_effective_target_fortran_large_real, which caches a
> result for a particular target name.

How about this patch version?

2006-10-05  Joseph Myers  <joseph@codesourcery.com>

	* lib/target-supports.exp
	(check_effective_target_vect_cmdline_needed): Handle i?86-*-* the
	same as x86_64-*-*; check for LP64.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 117455)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -1207,18 +1207,33 @@
 
 # Return 1 if the target needs a command line argument to enable a SIMD
 # instruction set.
-#
-# This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_cmdline_needed { } {
     global et_vect_cmdline_needed_saved
+    global et_vect_cmdline_needed_target_name
 
+    if { ![info exists et_vect_cmdline_needed_target_name] } {
+	set et_vect_cmdline_needed_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_vect_cmdline_needed_target_name } {
+	verbose "check_effective_target_vect_cmdline_needed: `$et_vect_cmdline_needed_target_name' `$current_target'" 2
+	set et_vect_cmdline_needed_target_name $current_target
+	if { [info exists et_vect_cmdline_needed_saved] } {
+	    verbose "check_effective_target_vect_cmdline_needed: removing cached result" 2
+	    unset et_vect_cmdline_needed_saved
+	}
+    }
+
     if [info exists et_vect_cmdline_needed_saved] {
 	verbose "check_effective_target_vect_cmdline_needed: using cached result" 2
     } else {
 	set et_vect_cmdline_needed_saved 1
 	if { [istarget ia64-*-*]
-	      || [istarget x86_64-*-*] } {
+	     || (([istarget x86_64-*-*] || [istarget i?86-*-*])
+		 && [check_effective_target_lp64])} {
 	   set et_vect_cmdline_needed_saved 0
 	}
     }

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list