From patchwork Wed Aug 31 09:33:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 57200 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F32D8383CCF1 for ; Wed, 31 Aug 2022 09:35:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F32D8383CCF1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661938501; bh=VlgaHrbwDlascBq9uESz/IirrRh1Eo2MYxXB2p2zcF4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=F3/E1epKCbino4ywPy+D3/UO29TMlilB6He3Cgx+MO8SnY0OzaH97J0uCTNg+P7/f AWwpoKGwS3Ffcc903+9XDoUXJZg+nhpAJRmMx7yevq8hVhH4EokzycPFuBqTFHbV0u If40c5Qe7l/TIFLOrcYhDteKIEe6mxfmEyvDUnuU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 1ED563858280 for ; Wed, 31 Aug 2022 09:34:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1ED563858280 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27V9EKpU027451; Wed, 31 Aug 2022 09:34:31 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ja4u28gye-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Aug 2022 09:34:30 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27V9GIq0003272; Wed, 31 Aug 2022 09:34:30 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ja4u28gpb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Aug 2022 09:34:28 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27V9K7om026108; Wed, 31 Aug 2022 09:33:34 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma01fra.de.ibm.com with ESMTP id 3j8hkaagv0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Aug 2022 09:33:34 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27V9XWOc36897256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Aug 2022 09:33:32 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E93EA4040; Wed, 31 Aug 2022 09:33:32 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 657FEA4051; Wed, 31 Aug 2022 09:33:30 +0000 (GMT) Received: from [9.197.247.44] (unknown [9.197.247.44]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 31 Aug 2022 09:33:30 +0000 (GMT) Message-ID: <69277846-f587-b79e-f741-a2942d326778@linux.ibm.com> Date: Wed, 31 Aug 2022 17:33:28 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: GCC Patches Subject: [PATCH] rs6000/test: Fix bswap64-4.c with has_arch_ppc64 [PR106680] X-TM-AS-GCONF: 00 X-Proofpoint-GUID: P-P5OGkAoGlX13BRKKfv8KImKAGihOuh X-Proofpoint-ORIG-GUID: UXMxZCkjjlqBwBnv5vC-ed9MhRW1Lguy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-31_05,2022-08-31_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 mlxscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208310047 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Kewen.Lin via Gcc-patches" From: "Kewen.Lin" Reply-To: "Kewen.Lin" Cc: Peter Bergner , David Edelsohn , Segher Boessenkool Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, Test case bswap64-4.c suffers the issue as its comments: /* On some versions of dejagnu this test will fail when biarch testing with RUNTESTFLAGS="--target_board=unix '{-m64,-m32}'" due to -m32 being added on the command line after the dg-options -mpowerpc64. common/config/rs6000/rs6000-common.c: rs6000_handle_option disables -mpowerpc64 for -m32. */ As tested, on test machine with dejaGnu 1.6.2, the compilation option order looks like: -m32 ... -mpowerpc64, option -mpowerpc64 still takes effect; While on test machine with dejaGnu 1.5.1, the option order looks like: -mpowerpc64 ... -m32, option -mpowerpc64 is disabled by -m32, then the case fails. This fix leverages the new effective target has_arch_ppc64 and places dg-options before dg-require-effective-target (it makes dg-options to be used for has_arch_ppc64 checking), on machine with dejaGnu 1.6.2, the checking succeeds and the case passes; while on machine with dejaGnu 1.5.1, the checking fails then the case is marked as unsupported. Tested on powerpc64-linux-gnu P7 and P8, and powerpc64le-linux-gnu P9 and P10. I'll push this soon if no objections. BR, Kewen ----- PR testsuite/106680 gcc/testsuite/ChangeLog: * gcc.target/powerpc/bswap64-4.c: Adjust with has_arch_ppc64. --- gcc/testsuite/gcc.target/powerpc/bswap64-4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.27.0 diff --git a/gcc/testsuite/gcc.target/powerpc/bswap64-4.c b/gcc/testsuite/gcc.target/powerpc/bswap64-4.c index 5acbb91ee38..85a7bbbd367 100644 --- a/gcc/testsuite/gcc.target/powerpc/bswap64-4.c +++ b/gcc/testsuite/gcc.target/powerpc/bswap64-4.c @@ -1,7 +1,8 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ /* { dg-skip-if "" { powerpc*-*-aix* } } */ -/* { dg-options "-O2 -mpowerpc64" } */ /* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O2 -mpowerpc64" } */ +/* { dg-require-effective-target has_arch_ppc64 } */ /* { dg-final { scan-assembler-times "lwbrx" 2 { target { ! has_arch_pwr7 } } } } */ /* { dg-final { scan-assembler-times "stwbrx" 2 { target { ! has_arch_pwr7 } } } } */ /* { dg-final { scan-assembler-times "ldbrx" 1 { target has_arch_pwr7 } } } */