From patchwork Mon Aug 7 13:32:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schulze Frielinghaus X-Patchwork-Id: 131992 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1454075vqr; Mon, 7 Aug 2023 06:35:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUIljqPHP7vri3Bvh2TFsChJSJl4prQXeu/4Dsz0tOZ8I8jshyNPUyRG6pTbPQhKvRK1K2 X-Received: by 2002:a17:906:51d7:b0:994:9ed:300b with SMTP id v23-20020a17090651d700b0099409ed300bmr9862062ejk.16.1691415311838; Mon, 07 Aug 2023 06:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691415311; cv=none; d=google.com; s=arc-20160816; b=ZKMDdMvzzpbPyP0bLGgGZUlkqlpUkVK5Zx6c9QOriWhzPSugfA+VmYQ5T5+QkwSZse wLU6I+ntd+oNvzYx2CZM6ZC3giEjPgTGKLyu7WhIxPhtqSEVrSzto+PpyDxqMTBO0kYE ivecDWGV4IZ4dDW0fxspeqLXM8IXFEUeOvjW5NiimyOT+8fSz6t4PUly7/bm4Rs52UpH KStxCqTiBjmHKJlmms/OmgepOMXtfBMAKIrMwnltZo+4kxfEx476Adpkj65JE/a626UE QKw91gYanikOF30KmBOygwSvK4woAx/LHuHRbSZHkeEtUhe1Lof3+KGvR742z0EMVQrw bsVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=GTI+KZGa/+ACcq7QzK3nhpTPr9Xqn/ufKDfcRVZu+v0=; fh=HMaSBIaXHQWtzxUV9NgXQx0dxb10mZXjfEfy0AoTSJY=; b=qkT2sORZRZRNS3s6hf6FGt8Vq1T4PJe9oIdZKbmtulq8dVoXdlo696PDnQeeSzGg+C p+xuD8wHGKTJM91QtoVpK6Q2h64E0dF3Eeq2k7f9F8POHPkCwYAfjnszSi7Q0j/HR8nF FREo0uf9MNlCNCUtDS5ViDrTNgcc79NYkxUBp6gKMFYB3wC+Q9AIyE2oamPrvw8m6hyf +B6v5iaHxgqoeOUkkL1KOYwWUQlJkWhItG5w787a5sIpoXmaASg/8HiECSuqrcF2DUka pLQFUnO5zi/R8yRGjhI9WavkMugIhgjLvxVtXzP/VmJNcNCfsldSM9d3bw+z/ni8n7P1 zh5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ssUc5LrX; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id m21-20020a170906161500b009932528281asi6312599ejd.579.2023.08.07.06.35.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 06:35:11 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ssUc5LrX; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B29F33857C55 for ; Mon, 7 Aug 2023 13:35:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B29F33857C55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691415310; bh=GTI+KZGa/+ACcq7QzK3nhpTPr9Xqn/ufKDfcRVZu+v0=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ssUc5LrXKmyEHMNL6GJtRQDZS8k3xvJA+Yg+Yvp1/A1W/UvhJh+tOgEsTcjJjY70H cTM9rP+hXjZ1Fpv9naUYvo+x5QlBkaEpRGFlpzv54tbyvl9+eNd/tCQZ96HcHTdf67 gYSwG8TZfiDP7txvUo7urHzf6XPE9uZWUw8Y5u+I= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 00D8D385840B for ; Mon, 7 Aug 2023 13:34:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 00D8D385840B Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 377DVw97001001 for ; Mon, 7 Aug 2023 13:34:27 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3sb1jn04ct-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 07 Aug 2023 13:34:26 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 377D2cTR030391 for ; Mon, 7 Aug 2023 13:34:25 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3sa1rmweju-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 07 Aug 2023 13:34:25 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 377DYMlI43385162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Aug 2023 13:34:22 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F6672004B; Mon, 7 Aug 2023 13:34:22 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0780820040; Mon, 7 Aug 2023 13:34:22 +0000 (GMT) Received: from a8345010.lnxne.boe (unknown [9.152.108.100]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTPS; Mon, 7 Aug 2023 13:34:21 +0000 (GMT) To: gcc-patches@gcc.gnu.org Cc: Stefan Schulze Frielinghaus Subject: [PATCH] rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc Date: Mon, 7 Aug 2023 15:32:42 +0200 Message-ID: <20230807133241.197319-2-stefansf@linux.ibm.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: LkHx7y5X4EY5yrb0dCVB-l10RZOs_cml X-Proofpoint-ORIG-GUID: LkHx7y5X4EY5yrb0dCVB-l10RZOs_cml X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-07_14,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 malwarescore=0 bulkscore=0 clxscore=1015 phishscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308070126 X-Spam-Status: No, score=-8.3 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 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: Stefan Schulze Frielinghaus via Gcc-patches From: Stefan Schulze Frielinghaus Reply-To: Stefan Schulze Frielinghaus Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773577501630222953 X-GMAIL-MSGID: 1773577501630222953 This fixes the rather new tests cmp-mem-const-{1,2,3,4,5,6}.c for sparc. For -1 and -2 we need at least optimization level 2 on sparc. For the sake of homogeneity, change all test cases to -O2. For -3 and -4 we do not end up with a comparison of memory and a constant, and finally for -5 and -6 the constants are reduced by a prior optimization which means there is nothing left to do. Thus excluding sparc from those tests. Ok for mainline? gcc/testsuite/ChangeLog: PR rtl-optimization/110869 * gcc.dg/cmp-mem-const-1.c: Use optimization level 2. * gcc.dg/cmp-mem-const-2.c: Dito. * gcc.dg/cmp-mem-const-3.c: Exclude sparc from this test. * gcc.dg/cmp-mem-const-4.c: Dito. * gcc.dg/cmp-mem-const-5.c: Dito. * gcc.dg/cmp-mem-const-6.c: Dito. --- gcc/testsuite/gcc.dg/cmp-mem-const-1.c | 2 +- gcc/testsuite/gcc.dg/cmp-mem-const-2.c | 2 +- gcc/testsuite/gcc.dg/cmp-mem-const-3.c | 6 ++++-- gcc/testsuite/gcc.dg/cmp-mem-const-4.c | 6 ++++-- gcc/testsuite/gcc.dg/cmp-mem-const-5.c | 6 ++++-- gcc/testsuite/gcc.dg/cmp-mem-const-6.c | 6 ++++-- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-1.c b/gcc/testsuite/gcc.dg/cmp-mem-const-1.c index 4f21a1ade4a..0b0e7331354 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-1.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { lp64 } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to QI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-2.c b/gcc/testsuite/gcc.dg/cmp-mem-const-2.c index 7b722951594..8022137a8ec 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-2.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-2.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { lp64 } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to QI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-3.c b/gcc/testsuite/gcc.dg/cmp-mem-const-3.c index ed5059d3807..c60ecdb4026 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-3.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-3.c @@ -1,5 +1,7 @@ -/* { dg-do compile { target { lp64 } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */ +/* Excluding sparc since there we do not end up with a comparison of memory and + a constant which means that the optimization is not applicable. */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to HI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-4.c b/gcc/testsuite/gcc.dg/cmp-mem-const-4.c index 23e83372bee..7aa403d76d9 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-4.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-4.c @@ -1,5 +1,7 @@ -/* { dg-do compile { target { lp64 } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */ +/* Excluding sparc since there we do not end up with a comparison of memory and + a constant which means that the optimization is not applicable. */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to HI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-5.c b/gcc/testsuite/gcc.dg/cmp-mem-const-5.c index d266896a25e..4316dcb5605 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-5.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-5.c @@ -1,5 +1,7 @@ -/* { dg-do compile { target { lp64 } && ! target { sparc*-*-* } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */ +/* Excluding sparc since there a prior optimization already reduced the + constant, i.e., nothing left for us. */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to SI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t; diff --git a/gcc/testsuite/gcc.dg/cmp-mem-const-6.c b/gcc/testsuite/gcc.dg/cmp-mem-const-6.c index 68d7a9d0265..d9046af79eb 100644 --- a/gcc/testsuite/gcc.dg/cmp-mem-const-6.c +++ b/gcc/testsuite/gcc.dg/cmp-mem-const-6.c @@ -1,5 +1,7 @@ -/* { dg-do compile { target { lp64 } && ! target { sparc*-*-* } } } */ -/* { dg-options "-O1 -fdump-rtl-combine-details" } */ +/* { dg-do compile { target { lp64 && { ! sparc*-*-* } } } } */ +/* Excluding sparc since there a prior optimization already reduced the + constant, i.e., nothing left for us. */ +/* { dg-options "-O2 -fdump-rtl-combine-details" } */ /* { dg-final { scan-rtl-dump "narrow comparison from mode .I to SI" "combine" } } */ typedef __UINT64_TYPE__ uint64_t;