From patchwork Tue Jun 21 21:02:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janis Johnson X-Patchwork-Id: 101366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B4D27B6F87 for ; Wed, 22 Jun 2011 07:00:24 +1000 (EST) Received: (qmail 31961 invoked by alias); 21 Jun 2011 21:00:22 -0000 Received: (qmail 31952 invoked by uid 22791); 21 Jun 2011 21:00:22 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Jun 2011 21:00:06 +0000 Received: (qmail 9905 invoked from network); 21 Jun 2011 21:00:05 -0000 Received: from unknown (HELO ?192.168.1.5?) (janisjo@127.0.0.2) by mail.codesourcery.com with ESMTPA; 21 Jun 2011 21:00:05 -0000 Message-ID: <4E0106DD.1050307@codesourcery.com> Date: Tue, 21 Jun 2011 14:02:21 -0700 From: Janis Johnson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [testsuite] dg-require-effective-target: skip unneeded checks X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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"] } }