From patchwork Mon Jun 18 23:51:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janis Johnson X-Patchwork-Id: 165624 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 DD1E0B700A for ; Tue, 19 Jun 2012 09:51:08 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1340668269; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Message-ID:Date:From:Reply-To:User-Agent:MIME-Version: To:Subject:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=gNvmypbQvzr31WdqfofCpCNRBUg=; b=s2u/hljrJGMjQeV XGF39P0hq7YL2WIfaPU1CJh9T42JGyfgj8IMsH1QfbjIGPfYI+dAnT7KW+YByI46 5h1ATBhji28/DvdPyVzfPjLP3dg1IZrPR0zJJxDoWoi80Vid+b/83HjcRmYDfe1h Gxnx9Xt2xQuiyNWs+jmvzGJHYE40= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Message-ID:Date:From:Reply-To:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=wRX6/OPNFOoyihzt7ubii7u2Wnl49cnt7skG/TelRHKybrs/sbadfhuiBsRqne oD4gfOsVntkHURBLOkXyzx4S4JZdkzNyTbXOnR/SFqXsM0HOpKH2DRoyLfS7xgEl 17qWy3bqf+BCuxgNvug/rVSY8B0AipnanhKH84I8KMkIs=; Received: (qmail 9077 invoked by alias); 18 Jun 2012 23:51:02 -0000 Received: (qmail 9061 invoked by uid 22791); 18 Jun 2012 23:51:00 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jun 2012 23:50:37 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SgliO-0000UP-GQ from Janis_Johnson@mentor.com for gcc-patches@gcc.gnu.org; Mon, 18 Jun 2012 16:50:36 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 18 Jun 2012 16:49:57 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.1.289.1; Mon, 18 Jun 2012 16:50:35 -0700 Message-ID: <4FDFBEF8.9060602@mentor.com> Date: Mon, 18 Jun 2012 16:51:20 -0700 From: Janis Johnson Reply-To: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [testsuite] profopt.exp and friends: use expected list of options 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 There are tests in g++.tree-prof that have non-unique lines in test summaries for scan-*-dump checks. Investigation showed that these tests were being run multiple times, for a list of options that had leaked over from another set of profile-directed optimization tests. This patch doesn't fix duplicate lines for checks in profiled tests that are run multiple times, but it does avoid the problem and, in so doing, fix tests that use profopt.exp so they are run with the correct sets of options. Without this patch, tests in g++.dg/tree-prof are run with [ { -g } { -O0 } { -O1 } { -O2 } { -O3 } { -O3 -g } { -Os } ] instead of the expected [list {}]. Each test provides its own options, so the ones from PROFOPT_OPTIONS were ignored. Tests gcc.misc-tests/bprob*.c were supposed to be run with a set of options that was instead overridden by an empty list. This patch makes it use [ { -O2 } {-O3 } ] so the options tested there will get some coverage with optimization, although not as much as originally planned when the tests were added years and years ago. The other sets of tests that use profopt.exp continue to be tested with the same options they've been using. OK for mainline? Janis 2012-06-18 Janis Johnson * lib/profopt.exp: Make prof_option_list local to profopt-execute. * g++.dg/tree-prof/tree-prof.exp (PROFOPT_OPTIONS): Define after including profopt.opt; save and restore existing value. * g++.dg/bprob/bprob.exp: Likewise. * gcc.dg/matrix/matrix.exp: Likewise. * gcc.dg/tree-prof/tree-prof.exp: Likewise. * gcc.misc-tests/bprob.exp: Likewise; also replace formerly-ignored PROFOPT_OPTIONS. Index: lib/profopt.exp =================================================================== --- lib/profopt.exp (revision 188753) +++ lib/profopt.exp (working copy) @@ -64,8 +64,6 @@ { -Os } ] } -set prof_option_list $PROFOPT_OPTIONS - # # profopt-cleanup -- remove profiling or performance results files. # @@ -215,7 +213,7 @@ # proc profopt-execute { src } { global srcdir tmpdir - global prof_option_list + global PROFOPT_OPTIONS global tool profile_option feedback_option prof_ext perf_ext perf_delta global generate_final_code use_final_code global verbose @@ -227,6 +225,12 @@ error "No feedback option specified for second compile." } + # Use the default option list or one defined for a set of tests. + if ![info exists PROFOPT_OPTIONS] { + error "PROFOPT_OPTIONS is not defined" + } + set prof_option_list $PROFOPT_OPTIONS + regsub "(?q)$srcdir/" $src "" testcase # If we couldn't rip $srcdir out of `src' then just do the best we can. # The point is to reduce the unnecessary noise in the logs. Don't strip Index: g++.dg/tree-prof/tree-prof.exp =================================================================== --- g++.dg/tree-prof/tree-prof.exp (revision 188753) +++ g++.dg/tree-prof/tree-prof.exp (working copy) @@ -29,9 +29,6 @@ set tool g++ set prof_ext "gcda" -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - if $tracelevel then { strace $tracelevel } @@ -39,6 +36,10 @@ # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set treeprof_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list {}] + # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. @@ -52,3 +53,5 @@ } profopt-execute $src } + +set PROFOPT_OPTIONS $treeprof_save_profopt_options Index: g++.dg/bprob/bprob.exp =================================================================== --- g++.dg/bprob/bprob.exp (revision 188753) +++ g++.dg/bprob/bprob.exp (working copy) @@ -33,7 +33,11 @@ strace $tracelevel } -# Override the list defined in profopt.exp. +# Load support procs. +load_lib profopt.exp + +# Save and override the default list defined in profopt.exp. +set bprob_save_profopt_options $PROFOPT_OPTIONS set PROFOPT_OPTIONS [list \ { -g } \ { -O0 } \ @@ -47,9 +51,6 @@ strace $tracelevel } -# Load support procs. -load_lib profopt.exp - set profile_options "-fprofile-arcs" set feedback_options "-fbranch-probabilities" @@ -63,3 +64,5 @@ profopt-execute $src } } + +set PROFOPT_OPTIONS $bprob_save_profopt_options Index: gcc.dg/matrix/matrix.exp =================================================================== --- gcc.dg/matrix/matrix.exp (revision 188753) +++ gcc.dg/matrix/matrix.exp (working copy) @@ -39,9 +39,6 @@ set tool gcc set prof_ext "gcda" -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - if $tracelevel then { strace $tracelevel } @@ -49,6 +46,10 @@ # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set matrix_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list {}] + # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. @@ -63,3 +64,4 @@ profopt-execute $src } +set PROFOPT_OPTIONS $matrix_save_profopt_options Index: gcc.dg/tree-prof/tree-prof.exp =================================================================== --- gcc.dg/tree-prof/tree-prof.exp (revision 188753) +++ gcc.dg/tree-prof/tree-prof.exp (working copy) @@ -29,9 +29,6 @@ set tool gcc set prof_ext "gcda" -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list {}] - if $tracelevel then { strace $tracelevel } @@ -39,6 +36,10 @@ # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set treeprof_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list {}] + # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. @@ -52,3 +53,5 @@ } profopt-execute $src } + +set PROFOPT_OPTIONS $treeprof_save_profopt_options Index: gcc.misc-tests/bprob.exp =================================================================== --- gcc.misc-tests/bprob.exp (revision 188753) +++ gcc.misc-tests/bprob.exp (working copy) @@ -30,16 +30,6 @@ set prof_ext "gcda" set perf_ext tim -# Override the list defined in profopt.exp. -set PROFOPT_OPTIONS [list \ - { -g } \ - { -O0 } \ - { -O1 } \ - { -O2 -DPERFTIME } \ - { -O3 -DPERFTIME } \ - { -O3 -g -DPERFTIME } \ - { -Os } ] - if $tracelevel then { strace $tracelevel } @@ -47,6 +37,10 @@ # Load support procs. load_lib profopt.exp +# Save and override the default list defined in profopt.exp. +set bprob_save_profopt_options $PROFOPT_OPTIONS +set PROFOPT_OPTIONS [list { -O2 } { -O3 }] + set profile_options "-fprofile-arcs" set feedback_options "-fbranch-probabilities" @@ -59,3 +53,5 @@ profopt-execute $src } } + +set PROFOPT_OPTIONS $bprob_save_profopt_options