From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 2A9F93858D1E for ; Sun, 17 Apr 2022 15:19:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A9F93858D1E Received: by mail-pj1-x102d.google.com with SMTP id n11-20020a17090a73cb00b001d1d3a7116bso2502372pjk.0 for ; Sun, 17 Apr 2022 08:19:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=e/bAkmFoowapDzIvr96d9/GZmuAP9AKa8cNLHsrwm6A=; b=7wkINSGI3Oki33FwlKEZRoaUhaXqQvzpW1cSFVQ0B/EpCvuzk8cyD4qTMIWMh5QRFk ycFBSfmKrsAi7i5ZdpQIH9cAh4okuUULAYuM1RbIZpTv5Ymn6WYr6J1qeX9SBnaZwQVI aFYmL6sHu7RFRwhkSdn6qOlnhdn4Z3rXoxi7e5QnVLpXMYMsyMyK40+7Q8+T3f8abjB3 K+nLEr1Mjkm41vC6/M/E4EBtH+FkyUoS6HAhpC2yaTehlfpp/aSEWHQ66LzwUv5b+bD6 Q2Qj3PaVIHfZTJsR783IR9N3h8YhwTuMNvSHhauR97CNru7/s8qgcDMx/JUx/rASfGlq RGzg== X-Gm-Message-State: AOAM531lk+sOBV0b4QlL+thUJuhHwPpA3aiNW5GV5m5uKTZB1wDIOgl8 zKN0vKUj+pLoewsoXM7Q5buG X-Google-Smtp-Source: ABdhPJyUEtzkMbSEM5INrk2cHz/LM7zalbvNhA9RsQuRbNcl0pCJQ9pxM6zLHWGOBpGqqnKTW7scDg== X-Received: by 2002:a17:90b:1650:b0:1d2:828e:ae57 with SMTP id il16-20020a17090b165000b001d2828eae57mr3627853pjb.36.1650208754787; Sun, 17 Apr 2022 08:19:14 -0700 (PDT) Received: from takamaka.home ([184.69.131.86]) by smtp.gmail.com with ESMTPSA id c18-20020a056a000ad200b004cdccd3da08sm9599206pfl.44.2022.04.17.08.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Apr 2022 08:19:13 -0700 (PDT) Received: by takamaka.home (Postfix, from userid 1000) id 05E75A7575; Sun, 17 Apr 2022 08:19:13 -0700 (PDT) Date: Sun, 17 Apr 2022 08:19:12 -0700 From: Joel Brobecker To: Carl Love via Gdb-patches Cc: will schmidt , cel@us.ibm.com, Rogerio Alves , Joel Brobecker Subject: Re: [PATCH] Powerpc, fix vla-optimized-out.exp test Message-ID: References: <4d733e3a7a609709be1613359e7c91db869099ac.camel@us.ibm.com> <0b8f207eb10a8a339825478fb94f781a827321ac.camel@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b8f207eb10a8a339825478fb94f781a827321ac.camel@us.ibm.com> X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2022 15:19:18 -0000 Hello Carl, Thanks for the patch. > Powerpc, fix vla-optimized-out.exp test > > The size of the variable a is not optimized out on Intel inspite of the > use of the variable use being optimized out. > > On Powerpc, the use of variable a and the size of variable a are both > optimized out. For me, it would be useful to include an annotated copy of the DWARF info being produced on x86_64-linux where the size is available, vs the DWARF being produced on PowerPC. This will help understand what's happening and confirm that it is indeed valid for GDB to print that the size has been optimized out. > The output on Powerpc is: > > p sizeof (a) > $2 = > (gdb) FAIL: gdb.base/vla-optimized-out.exp: o1: printed size of optimized out vla > > This patch changes the gdb_test to check for the size of vla being > available or optimized out. In either case, the test now passes. > --- > gdb/testsuite/gdb.base/vla-optimized-out.exp | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.base/vla-optimized-out.exp b/gdb/testsuite/gdb.base/vla-optimized-out.exp > index b16142ee329..0a25788cb34 100644 > --- a/gdb/testsuite/gdb.base/vla-optimized-out.exp > +++ b/gdb/testsuite/gdb.base/vla-optimized-out.exp > @@ -40,8 +40,10 @@ proc vla_optimized_out {exe_suffix options} { > " = " \ > "printed optimized out vla" > > + # On Intel the variable use of variable a is optimized out but the size is > + # available. On Powerpc, the variable and the size of a are optimized out. > gdb_test "p sizeof (a)" \ > - " = ($sizeof_result)" \ > + "( = ($sizeof_result)| = )" \ > "printed size of optimized out vla" In situations like these, I would suggest using gdb_test_multiple instead. I think it'll make the testcase more readable. -- Joel