This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Update arm32 effective target check
- From: Daniel Jacobowitz <drow at false dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Janis Johnson <janis187 at us dot ibm dot com>
- Date: Wed, 15 Aug 2007 09:19:01 -0400
- Subject: 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