This patch causes dg-require-effective-target to return early if the test is already being skipped, saving some work. There's already similar code in dg-skip-if.
OK for trunk, and later for 4.6?
2011-06-21 Janis Johnson <jani...@codesourcery.com> * lib/target-supports-dg.exp (dg-require-effective-target): Return early if the test is already being skipped. Index: lib/target-supports-dg.exp =================================================================== --- lib/target-supports-dg.exp (revision 175269) +++ lib/target-supports-dg.exp (working copy) @@ -172,6 +172,12 @@ if { [llength $args] < 1 || [llength $args] > 2 } { error "syntax error, need a single effective-target keyword with optional selector" } + + # Don't bother if we're already skipping the test. + upvar dg-do-what dg-do-what + if { [lindex ${dg-do-what} 1] == "N" } { + return + } # Evaluate selector if present. if { [llength $args] == 2 } { @@ -182,7 +188,6 @@ } if { ![is-effective-target [lindex $args 0]] } { - upvar dg-do-what dg-do-what set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] } }