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]

Update arm32 effective target check


check_effective_target_arm32 is the only user of the global
compiler_flags in target-supports.exp, and it shouldn't be using them
either.  At the point effective target keywords are checked,
compiler_flags is either the compilation flags for the previous test,
or empty if there was an earlier dg-skip-if / dg-xfail-if.

I rewrote it to check for preprocessor macros, the way a number of
other checks do.  Janis, is this OK?  Paul's already checked that I
got the condition right.

-- 
Daniel Jacobowitz
CodeSourcery

2007-08-15  Daniel Jacobowitz  <dan@codesourcery.com>

	* lib/target-supports.exp (check_effective_target_arm32): Use
	check_no_compiler_messages.

Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 127130)
+++ lib/target-supports.exp	(working copy)
@@ -1413,39 +1413,11 @@ proc check_effective_target_vect_floatin
 
 # Return 1 is this is an arm target using 32-bit instructions
 proc check_effective_target_arm32 { } {
-    global et_arm32_saved
-    global et_arm32_target_name
-    global compiler_flags
-
-    if { ![info exists et_arm32_target_name] } {
-	set et_arm32_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_arm32_target_name } {
-	verbose "check_effective_target_arm32: `$et_arm32_target_name' `$current_target'" 2
-	set et_arm32_target_name $current_target
-	if { [info exists et_arm32_saved] } {
-	    verbose "check_effective_target_arm32: removing cached result" 2
-	    unset et_arm32_saved
-	}
-    }
-
-    if [info exists et_arm32_saved] {
-	verbose "check-effective_target_arm32: using cached result" 2
-    } else {
-	set et_arm32_saved 0
-	if { [istarget arm-*-*]
-	      || [istarget strongarm*-*-*]
-	      || [istarget xscale-*-*] } {
-	    if ![string match "*-mthumb *" $compiler_flags] {
-		set et_arm32_saved 1
-	    }
-	}
-    }
-    verbose "check_effective_target_arm32: returning $et_arm32_saved" 2
-    return $et_arm32_saved
+    return [check_no_compiler_messages arm32 assembly {
+	#if !defined(__arm__) || (defined(__thumb__) && !defined(__thumb2__))
+	#error FOO
+	#endif
+    }]
 }
 
 # Return 1 if this is an ARM target supporting -mfpu=vfp


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