+2012-02-05 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * lib/target-supports.exp (check_effective_target_mips_llsc): New.
+ (check_effective_target_sync_int_long): Use it.
+ (check_effective_target_sync_char_short): Likewise.
+ * gcc.target/mips/atomic-memory-1.c: Restrict error check to mips_llsc.
+
2012-02-05 Tobias Burnus <burnus@net-b.de>
PR fortran/51972
} "-mabi=64"]
}
+# Return true if the target is a MIPS target that has access
+# to the LL and SC instructions.
+
+proc check_effective_target_mips_llsc { } {
+ if { ![istarget mips*-*-*] } {
+ return 0
+ }
+ # Assume that these instructions are always implemented for
+ # non-elf* targets, via emulation if necessary.
+ if { ![istarget *-*-elf*] } {
+ return 1
+ }
+ # Otherwise assume LL/SC support for everything but MIPS I.
+ return [check_no_compiler_messages mips_llsc assembly {
+ #if __mips == 1
+ #error FOO
+ #endif
+ }]
+}
+
# Return 1 if the current multilib does not generate PIC by default.
proc check_effective_target_nonpic { } {
|| [istarget powerpc*-*-*]
|| [istarget sparc64-*-*]
|| [istarget sparcv9-*-*]
- || [istarget mips*-*-*] } {
+ || [check_effective_target_mips_llsc] } {
set et_sync_int_long_saved 1
}
}
|| [istarget powerpc*-*-*]
|| [istarget sparc64-*-*]
|| [istarget sparcv9-*-*]
- || [istarget mips*-*-*] } {
+ || [check_effective_target_mips_llsc] } {
set et_sync_char_short_saved 1
}
}