From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6321B3858D32 for ; Fri, 31 Mar 2023 18:52:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6321B3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680288728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=txyS1JGsUM+pn9cp8u9w1e9URT538FrL8r6wgvFVOgc=; b=V5h5couZYSVrqhj5QQb1IaMPXshxHr/tSGvR4np3W3lS0eglhDT/PJ2rhu0/kXPU4LoPOv PRDn3dQC3LXZ0b7RCLJLGkRxq7tax09D3Q5WUIEj/qy/Kge4WU8pGuMfz7TCj+URJi16CR JTqLs83ZYuYS1VX2zbHFhzZWFY3oKSk= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-475-qHcRP2qjNXC6zmwNtPqKOw-1; Fri, 31 Mar 2023 14:52:03 -0400 X-MC-Unique: qHcRP2qjNXC6zmwNtPqKOw-1 Received: by mail-qt1-f200.google.com with SMTP id h6-20020a05622a170600b003e22c6de617so15263370qtk.13 for ; Fri, 31 Mar 2023 11:52:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680288723; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=txyS1JGsUM+pn9cp8u9w1e9URT538FrL8r6wgvFVOgc=; b=J+tu1MjeNNB+9xIFp2j60jnRHCb9cgSj40ZUZfUIkh30wK3jkXGSg0Xw3xfYJLrmv5 7sln3OEawWh1a9Q1r3cemNF921X/kCbT2sjz2zLMsmu/gmYVUnjTf3xWu+pm88Nb78yY Adju2sKh2BXCL8q7+8rbgCbCiS2GWqP/giO6oWVZOErN0ycfj1SoiEDwUPTJOWSiw73J kT9uoRjK6KH9FOe1wbc8Ht26IZxqI0NuT23qRX17aMAc8ottI2Rd1ca/aWstFbfvGIQm O99cBTvuushGuCB0b2HpH5olPJoPOIBX7/MGnV9Ath0lGQ3k24enzzuJjW/Lk65MsdyW s3PA== X-Gm-Message-State: AAQBX9dcOQaOj6bjcq1JJDs8NhoSIdyJpqydfi4dGN8VHs5Lu6sJ61jG qv8kYPh0NNHCmgdzmdT1BR/eizBy2LTRicO6nyz/mTY4ttP5E31xp84y/jyWzgMlqDyqu6wZXQc Rrecca3vdhQy4x7groQ== X-Received: by 2002:a05:6214:4102:b0:56e:f4e0:a4ea with SMTP id kc2-20020a056214410200b0056ef4e0a4eamr46452257qvb.17.1680288723365; Fri, 31 Mar 2023 11:52:03 -0700 (PDT) X-Google-Smtp-Source: AKy350beFOZ0igynDAVoyUmyeEsuxNP6oya4CWOeLRvxl3BcOCFWdakYiuHYfLjIgE04e6w8kOEEBQ== X-Received: by 2002:a05:6214:4102:b0:56e:f4e0:a4ea with SMTP id kc2-20020a056214410200b0056ef4e0a4eamr46452235qvb.17.1680288723047; Fri, 31 Mar 2023 11:52:03 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id s11-20020a05621412cb00b005df44d4d953sm773260qvv.127.2023.03.31.11.52.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Mar 2023 11:52:02 -0700 (PDT) Message-ID: Date: Fri, 31 Mar 2023 14:52:00 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: 'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899] To: Alexandre Oliva , Thomas Schwinge Cc: gcc-patches@gcc.gnu.org, Jakub Jelinek , Richard Biener , ro@cebitec.uni-bielefeld.de, mikestump@comcast.net, nathan@acm.org References: <00f5cbe1-05b7-0e42-0b46-1e36d1e4e8b3@redhat.com> <87o7ob2usn.fsf@euler.schwinge.homeip.net> From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 3/30/23 09:51, Alexandre Oliva wrote: > On Mar 30, 2023, Alexandre Oliva wrote: > >> If we're dropping the renaming, I suppose we could also revert Jakub's >> change. I suppose this patch will take care of it, pending testing... > > Regstrapped on x86_64-linux-gnu and also tested on arm-vx7r2 (with > gcc-12), where I used to get fails after an unsupported modules.exp > test, but there are no curly braces in the log files after the patch. > Ok to install? > > > [PR108899] testsuite: fix proc unsupported overriding in modules.exp The [PR] tag should go at the end of the subject line, not the start. OK with that change. > The overrider of proc unsupported in modules.exp had two problems > reported by Thomas Schwinge, even after Jakub JelĂ­nek's fix: > > - it remained in effect while running other dejagnu testsets > > - it didn't quote correctly the argument list passed to it, which > caused test names to be surrounded by curly braces, as in: > > UNSUPPORTED: {...} > > This patch fixes both issues, obsoleting and reverting Jakub's change, > by dropping the overrider and renaming the saved proc back, and by > using uplevel's argument list splicing. > > > for gcc/testsuite/ChangeLog > > PR testsuite/108899 > * g++.dg/modules/modules.exp (unsupported): Drop renaming. > Fix quoting. > --- > gcc/testsuite/g++.dg/modules/modules.exp | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp > index 80aa392bc7f3b..dc302d3d0af48 100644 > --- a/gcc/testsuite/g++.dg/modules/modules.exp > +++ b/gcc/testsuite/g++.dg/modules/modules.exp > @@ -319,15 +319,11 @@ cleanup_module_files [find $DEFAULT_REPO *.gcm] > # so that, after an unsupported result in dg-test, we can skip rather > # than fail subsequent related tests. > set module_do {"compile" "P"} > -if { [info procs unsupported] != [list] \ > - && [info procs saved-unsupported] == [list] } { > - rename unsupported saved-unsupported > - > - proc unsupported { args } { > - global module_do > - lset module_do 1 "N" > - return [saved-unsupported $args] > - } > +rename unsupported modules-saved-unsupported > +proc unsupported { args } { > + global module_do > + lset module_do 1 "N" > + return [uplevel 1 modules-saved-unsupported $args] > } > > # not grouped tests, sadly tcl doesn't have negated glob > @@ -412,4 +408,10 @@ foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] { > } > } > > +# Restore the original unsupported proc, lest it will affect > +# subsequent test runs, or even fail renaming if we run modules.exp > +# for multiple targets/multilibs/options. > +rename unsupported {} > +rename modules-saved-unsupported unsupported > + > dg-finish > >