From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id E770F3858C56 for ; Mon, 28 Mar 2022 15:34:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E770F3858C56 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22SFGw9g038604 for ; Mon, 28 Mar 2022 15:34:14 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 3f3fh9gbt4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 28 Mar 2022 15:34:14 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22SFI0D4016873 for ; Mon, 28 Mar 2022 15:34:13 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma05wdc.us.ibm.com with ESMTP id 3f1tf9p675-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 28 Mar 2022 15:34:13 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22SFYDKq32178636 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Mar 2022 15:34:13 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 65AD8AC059; Mon, 28 Mar 2022 15:34:13 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CCDFBAC05E; Mon, 28 Mar 2022 15:34:12 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.92.208]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 28 Mar 2022 15:34:12 +0000 (GMT) Message-ID: <0b8f207eb10a8a339825478fb94f781a827321ac.camel@us.ibm.com> Subject: Re: [PATCH] Powerpc, fix vla-optimized-out.exp test From: Carl Love To: will schmidt , gdb-patches@sourceware.org, cel@us.ibm.com Cc: Rogerio Alves Date: Mon, 28 Mar 2022 08:34:12 -0700 In-Reply-To: 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: TcgG9LRxAtDrVsMy3RhZFJrg6tJxT-7i X-Proofpoint-ORIG-GUID: TcgG9LRxAtDrVsMy3RhZFJrg6tJxT-7i 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-28_06,2022-03-28_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 phishscore=0 spamscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 mlxscore=0 mlxlogscore=702 adultscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203280087 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: Mon, 28 Mar 2022 15:34:20 -0000 GDB maintainers, Will: I updated the commit log and comments to say variable a not vla per Will's comments. The updated patch is below. As mentioned earlier, I don't think it is appropriate to change the test so variable a is not optimized out. The test does expect that it will be optimized out. Carl ------------------------------------------------------------------- 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 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. 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" # At lower optimisation levels, the upper bound of the array is -- 2.31.1