From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61899 invoked by alias); 4 Sep 2015 14:59:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 61889 invoked by uid 89); 4 Sep 2015 14:59:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f46.google.com Received: from mail-qg0-f46.google.com (HELO mail-qg0-f46.google.com) (209.85.192.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 04 Sep 2015 14:59:55 +0000 Received: by qgev79 with SMTP id v79so17913357qge.0 for ; Fri, 04 Sep 2015 07:59:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=9I+f4Sv5A+g2ceNimgvz8VOa2bNWF2ORyw0XP1WKEaM=; b=jkhOGk7IOh4H2yngxvQY9GZErOW1R0i4ErM3JnwO4eXODOig9sLZRPWyHJwVHb6vE4 cvqAeC8K2l0XISplQmtvDBvvdy7NKZxVcfg9pNp6848/Kd3PlyjRSPjO1HRq5IWFZhYM mykPwKlwHfiuPutbT+OFfWOf2+EBdix6zqaiwjGB1FpZ3sANjNAIbdBt5VwJLABMie5r aImsQKLPUpBNpTCvJhGT/g0Rj4gBcgMfLkc7BV/5fwAxvM/KJFQTY+8Q9NCeuboW6xY8 peG90+GYCcXwqJqHKOojX2avgcL0fXdjdp//Gq89P12guQS5fhNe5G2lJE3Z7G/m0Jtq x5Jg== X-Gm-Message-State: ALoCoQmm9NDQlMSjwRJPqf2uDlS0Cf1dX+fKQ9YaF8soF4CvwwYC1z0m1kAVlnrswErAmHM3ORw4 MIME-Version: 1.0 X-Received: by 10.140.33.225 with SMTP id j88mr5815955qgj.30.1441378793342; Fri, 04 Sep 2015 07:59:53 -0700 (PDT) Received: by 10.140.96.71 with HTTP; Fri, 4 Sep 2015 07:59:53 -0700 (PDT) In-Reply-To: References: <14DA89C6-4F95-4A90-847A-6B6E6909475A@comcast.net> Date: Fri, 04 Sep 2015 15:02:00 -0000 Message-ID: Subject: Re: [testsuite] Clean up effective_target cache From: Christophe Lyon To: "H.J. Lu" Cc: Mike Stump , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00358.txt.bz2 On 4 September 2015 at 16:54, H.J. Lu wrote: > On Fri, Sep 4, 2015 at 7:52 AM, Christophe Lyon > wrote: >> On 4 September 2015 at 15:58, H.J. Lu wrote: >>> On Fri, Sep 4, 2015 at 6:15 AM, Christophe Lyon >>> wrote: >>>> On 4 September 2015 at 14:13, H.J. Lu wrote: >>>>> On Fri, Sep 4, 2015 at 4:47 AM, H.J. Lu wrote: >>>>>> On Fri, Sep 4, 2015 at 4:27 AM, H.J. Lu wrote: >>>>>>> On Fri, Sep 4, 2015 at 4:18 AM, H.J. Lu wrote: >>>>>>>> On Thu, Sep 3, 2015 at 8:03 AM, Christophe Lyon >>>>>>>> wrote: >>>>>>>>> On 3 September 2015 at 13:31, H.J. Lu wrote: >>>>>>>>>> On Wed, Sep 2, 2015 at 7:02 AM, Christophe Lyon >>>>>>>>>> wrote: >>>>>>>>>>> On 1 September 2015 at 16:04, Christophe Lyon >>>>>>>>>>> wrote: >>>>>>>>>>>> On 25 August 2015 at 17:31, Mike Stump = wrote: >>>>>>>>>>>>> On Aug 25, 2015, at 1:14 AM, Christophe Lyon wrote: >>>>>>>>>>>>>> Some subsets of the tests override ALWAYS_CXXFLAGS or >>>>>>>>>>>>>> TEST_ALWAYS_FLAGS and perform effective_target support tests= using >>>>>>>>>>>>>> these modified flags. >>>>>>>>>>>>> >>>>>>>>>>>>>> This patch adds a new function 'clear_effective_target_cache= ', which >>>>>>>>>>>>>> is called at the end of every .exp file which overrides >>>>>>>>>>>>>> ALWAYS_CXXFLAGS or TEST_ALWAYS_FLAGS. >>>>>>>>>>>>> >>>>>>>>>>>>> So, a simple English directive somewhere that says, if one ch= anges ALWAYS_CXXFLAGS or TEST_ALWAYS_FLAGS then they should do a clear_effe= ctive_target_cache at the end as the target cache can make decisions based = upon the flags, and those decisions need to be redone when the flags change= would be nice. >>>>>>>>>>>>> >>>>>>>>>>>>> I do wonder, do we need to reexamine when setting the flags? = I=E2=80=99m thinking of a sequence like: non-thumb default, is_thumb, set = flags (thumb), is_thumb. Anyway, safe to punt this until someone discovers= it or is reasonable sure it happens. >>>>>>>>>>>>> >>>>>>>>>>>>> Anyway, all looks good. Ok. >>>>>>>>>>>>> >>>>>>>>>>>> Here is what I have committed (r227372). >>>>>>>>>>> >>>>>>>>>>> Hmmm, in fact this was r227401. >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> It caused: >>>>>>>>>> >>>>>>>>>> ERROR: can't unset "et_cache(arm_neon_ok,value)": no such elemen= t in array >>>>>>>>>> ERROR: can't unset "et_cache(arm_neon_ok,value)": no such elemen= t in array >>>>>>>>>> ERROR: can't unset "et_cache(arm_neon_ok,value)": no such elemen= t in array >>>>>>>>>> ERROR: can't unset "et_cache(dfp,value)": no such element in arr= ay >>>>>>>>>> ERROR: can't unset "et_cache(fsanitize_address,value)": no such = element in array >>>>>>>>>> ERROR: can't unset "et_cache(ia32,value)": no such element in ar= ray >>>>>>>>>> ERROR: can't unset "et_cache(ia32,value)": no such element in ar= ray >>>>>>>>>> ERROR: can't unset "et_cache(ia32,value)": no such element in ar= ray >>>>>>>>>> ERROR: can't unset "et_cache(ia32,value)": no such element in ar= ray >>>>>>>>>> ERROR: can't unset "et_cache(ia32,value)": no such element in ar= ray >>>>>>>>>> ERROR: can't unset "et_cache(ilp32,value)": no such element in a= rray >>>>>>>>>> ERROR: can't unset "et_cache(ilp32,value)": no such element in a= rray >>>>>>>>>> ERROR: can't unset "et_cache(ilp32,value)": no such element in a= rray >>>>>>>>>> ERROR: can't unset "et_cache(ilp32,value)": no such element in a= rray >>>>>>>>>> ERROR: can't unset "et_cache(label_values,value)": no such eleme= nt in array >>>>>>>>>> ERROR: can't unset "et_cache(lp64,value)": no such element in ar= ray >>>>>>>>>> ERROR: can't unset "et_cache(lp64,value)": no such element in ar= ray >>>>>>>>>> ERROR: can't unset "et_cache(lp64,value)": no such element in ar= ray >>>>>>>>>> ERROR: can't unset "et_cache(ptr32plus,value)": no such element = in array >>>>>>>>>> ERROR: can't unset "et_cache(ptr32plus,value)": no such element = in array >>>>>>>>>> ... >>>>>>>>>> >>>>>>>>>> on Linux/x86-64: >>>>>>>>>> >>>>>>>>>> https://gcc.gnu.org/ml/gcc-testresults/2015-09/msg00167.html >>>>>>>>>> >>>>>>>>> >>>>>>>>> I'll have a look. >>>>>>>>> That's the configuration I used to check before committing, but I= am >>>>>>>>> going to re-check. >>>>>>>> >>>>>>>> proc check_cached_effective_target { prop args } { >>>>>>>> global et_cache >>>>>>>> global et_prop_list >>>>>>>> >>>>>>>> set target [current_target_name] >>>>>>>> if {![info exists et_cache($prop,target)] >>>>>>>> || $et_cache($prop,target) !=3D $target} { >>>>>>>> verbose "check_cached_effective_target $prop: checking $ta= rget" 2 >>>>>>>> set et_cache($prop,target) $target >>>>>>>> set et_cache($prop,value) [uplevel eval $args] >>>>>>>> lappend et_prop_list $prop >>>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>>>>>>> >>>>>>>> Aren't you appending $pop to et_prop_list even if it may be already >>>>>>>> on the list? >>>>>>>> >>>>>>>> verbose "check_cached_effective_target cached list is now: >>>>>>>> $et_prop_list" 2 >>>>>>>> } >>>>>>>> set value $et_cache($prop,value) >>>>>>>> verbose "check_cached_effective_target $prop: returning $value= for >>>>>>>> $target" 2 >>>>>>>> return $value >>>>>>>> } >>>>>>>> >>>>>>> >>>>>>> Like this? >>>>>>> >>>>>>> -- >>>>>>> H.J. >>>>>>> --- >>>>>>> diff --git a/gcc/testsuite/lib/target-supports.exp >>>>>>> b/gcc/testsuite/lib/target-supports.exp >>>>>>> index aad45f9..a6c16fe 100644 >>>>>>> --- a/gcc/testsuite/lib/target-supports.exp >>>>>>> +++ b/gcc/testsuite/lib/target-supports.exp >>>>>>> @@ -125,7 +125,9 @@ proc check_cached_effective_target { prop args = } { >>>>>>> verbose "check_cached_effective_target $prop: checking $target" 2 >>>>>>> set et_cache($prop,target) $target >>>>>>> set et_cache($prop,value) [uplevel eval $args] >>>>>>> - lappend et_prop_list $prop >>>>>>> + if {[lsearch $et_prop_list $prop] < 0} { >>>>>>> + lappend et_prop_list $prop >>>>>>> + } >>>>>>> verbose "check_cached_effective_target cached list is now: $et_pr= op_list" 2 >>>>>>> } >>>>>>> set value $et_cache($prop,value) >>>>>> >>>>>> >>>>>> It should be >>>>>> >>>>>> if {![info exists et_prop_list] >>>>>> || [lsearch $et_prop_list $prop] < 0} { >>>>>> lappend et_prop_list $prop >>>>>> } >>>>>> >>>>> >>>>> Here is a patch. OK for trunk? >>>>> >>>> >>>> It makes sense, indeed, although I still haven't managed to reproduce >>>> the issue you reported. >>> >>> The failure is random with parallel check on machines with >=3D 8 cores. >>> >> In fact that's because you are running the testsuite with several >> values for 'target' (unix and unix/-m32), which indeed result in >> appending $prop twice. > > Is my patch correct or you have a different fix? > It's OK for me, but I can't approve it. > -- > H.J.