From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 94350385F00F for ; Thu, 24 Mar 2022 22:46:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 94350385F00F Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22OK99Hg016763 for ; Thu, 24 Mar 2022 22:46:32 GMT Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 3f0t9dsn8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 Mar 2022 22:46:32 +0000 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22OMcTE1015869 for ; Thu, 24 Mar 2022 22:46:31 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma04dal.us.ibm.com with ESMTP id 3ew6taeswy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 Mar 2022 22:46:31 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22OMkSu37471968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Mar 2022 22:46:28 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B245DB2065; Thu, 24 Mar 2022 22:46:28 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0DE3DB2064; Thu, 24 Mar 2022 22:46:28 +0000 (GMT) Received: from sig-9-65-75-21.ibm.com (unknown [9.65.75.21]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 24 Mar 2022 22:46:27 +0000 (GMT) Message-ID: Subject: Re: [PATCH] Powerpc, fix vla-optimized-out.exp test From: will schmidt To: Carl Love , gdb-patches@sourceware.org Cc: Rogerio Alves Date: Thu, 24 Mar 2022 17:46:27 -0500 In-Reply-To: <4d733e3a7a609709be1613359e7c91db869099ac.camel@us.ibm.com> References: <4d733e3a7a609709be1613359e7c91db869099ac.camel@us.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: VNrPlErFO0pcITFVLg9BV1cRsL_8VTvq X-Proofpoint-ORIG-GUID: VNrPlErFO0pcITFVLg9BV1cRsL_8VTvq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-24_08,2022-03-24_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 spamscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=721 impostorscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203240119 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, 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: Thu, 24 Mar 2022 22:46:36 -0000 On Thu, 2022-03-24 at 14:41 -0700, Carl Love wrote: > GDB maintainers: > > The vla-optimized-out.exp test has a check to print the size of > variable a. The test expects the size to be available even though the > use of the variable has been optimized out. This is true on Intel. > However, on Powerpc both the use and the size of the variable are > optimized out. > > This patch adds to the test to check for the size or optimized out. The > change fixes the test failure on Powerpc. > > The patch has been tested on a Power 10 system and on and Intel 64-bit > system. No regressions were seen. > > Please let me know if this patch is acceptable for gdb mainline. > Thanks. > > Carl Love > > ------------------------------------------ > Powerpc, fix vla-optimized-out.exp test > > The size of the variable vla is not optimized out on Intel inspite of the > use of the variable use being optimized out. The variable in this case is actually just 'a'. The vla reference in the exp appears to be a copy/paste leftover from the nearby vla-ptr.c test. > On Powerpc, the use of vla and the size of vla are both optimized out. I fear this shortcuts the intent of the test. Can you instead update the test in a way that prevents 'a' from being 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..9a83b7ff81b 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 vla is optimized out but the size > + # is available. On Powerpc, the variable and the size are optimized out. > gdb_test "p sizeof (a)" \ > - " = ($sizeof_result)" \ > + "( = ($sizeof_result)| = )" \ > "printed size of optimized out vla" > > # At lower optimisation levels, the upper bound of the array is