From patchwork Fri Jan 6 09:28:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 40057 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp730470wrt; Fri, 6 Jan 2023 01:29:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXsGhuNSYK5dqwx8ujR8SpjlfsSny2uFw1Y9Ez7GaQQs4m/9OpmqiIdujqIUpIZHFkabbKWY X-Received: by 2002:aa7:c911:0:b0:48d:4504:32ed with SMTP id b17-20020aa7c911000000b0048d450432edmr16235443edt.37.1672997364303; Fri, 06 Jan 2023 01:29:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672997364; cv=none; d=google.com; s=arc-20160816; b=DKkLxKHMyk8yCR9w4MJk8GUjdoSxwFuV7958x33QQO05a8xHkMhTZaNeTOtN+OMEZp 1HkW0SmoP/m+5n5IMAWWQx4ISMLCqW8TnW556tKt8j+WDgsIpOFBXFvGXdIKXzJ+gd8m YElyU5oTx5nND6oyVlxr/HFsA+woa+Bp8wKQfvKsirR/msQ3sYGg+bEoxxoQKNP7Ivka Ej8U+EBvro4G4ohzpiYkiXBGFfsXFprQquucDcDArqJS10cgE4u17tAWtaVPScC4GhSt UgnmzZIigML+rjwjuCqGRskFxuyP+8Jmx1aG4xBTJYod8p5mK2CBHABnEToNbK203r3G gvUA== 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:cc:to:subject:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=m/YSHyvOT4BIEYZc4pdCn3PZ3tfKhC3XjuBQvOSpw9s=; b=qQn2LgKtk0on0R/sgT7vSidyoGbRMSaLP8eINQwl+eJugqCtHkqI3vzQMfAfygCdjC kJCIO0eP2QU+SLWz8EGgcn9eZCSiBNB+xkTqOumbHAX8xzdAjm4b37q9wYsnTvIYjiji N95LmQGIACO5/3nf5eablHqHMIwDW38EKV/aRUJSz1LpUV1WQx5M5QYtGBjVHHxIbnlB heQ9rY1PXYIJ+Ah96ahQbIIdya+adSUWYlkk13AJzncHiA9NNZOSZA0mN2MzBcOClYsL 2mfQdCrwylAm8f1/1fLXbfBxqRgxwcDXQ9/TYivm0iZyKBSPd8eYTSgscEumDl5CEvCZ jExQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="aA/04cfC"; 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 sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f28-20020a50d55c000000b0048e927edec3si1081943edj.272.2023.01.06.01.29.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 01:29:24 -0800 (PST) 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="aA/04cfC"; 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 44EE63858D33 for ; Fri, 6 Jan 2023 09:29:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 44EE63858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672997361; bh=m/YSHyvOT4BIEYZc4pdCn3PZ3tfKhC3XjuBQvOSpw9s=; h=Date:Subject:To:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=aA/04cfCTqVxWQQtSFkVLSQ9/C9f4kQFYxbTD6KLzv9C0U4PuL8VR5QUrenCysgWo I5nRBPR5NCw6+MLwMWoaHkHJ8Fw5BV/KmtZP+r+5h+MUmlz3DsFJZ126dLaAxsCBEV X60yxZnz90Zw3C2b4zBSrY60LEbA8XuCeAIFYuZM= 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 32EBB3858D28 for ; Fri, 6 Jan 2023 09:28:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 32EBB3858D28 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3066U0hx023331; Fri, 6 Jan 2023 09:28:35 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mxee8k3ym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Jan 2023 09:28:34 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3069LUQ9017595; Fri, 6 Jan 2023 09:28:34 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mxee8k3y9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Jan 2023 09:28:34 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3068Z41G002786; Fri, 6 Jan 2023 09:28:32 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3mtcq6g31r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Jan 2023 09:28:31 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3069STqO44695952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Jan 2023 09:28:29 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 737BF20043; Fri, 6 Jan 2023 09:28:29 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C75C120040; Fri, 6 Jan 2023 09:28:27 +0000 (GMT) Received: from [9.197.231.22] (unknown [9.197.231.22]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 6 Jan 2023 09:28:27 +0000 (GMT) Message-ID: Date: Fri, 6 Jan 2023 17:28:26 +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 Subject: [PATCH] rs6000: Allow powerpc64 to be unset for implicit 64 bit [PR108240] To: GCC Patches Cc: Segher Boessenkool , David Edelsohn , Peter Bergner X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 4zP0RlEPb0gXL63r6WpHuJRXZjuQrWp3 X-Proofpoint-ORIG-GUID: _tVdVaREys5ct47A7UXRvoe4B-1WjxyA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-06_05,2023-01-05_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 mlxscore=0 mlxlogscore=932 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301060066 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, 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: "Kewen.Lin via Gcc-patches" From: "Kewen.Lin" Reply-To: "Kewen.Lin" Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754264884623154242?= X-GMAIL-MSGID: =?utf-8?q?1754264884623154242?= Hi, Before r13-4894, if 64 bit is explicitly specified, option powerpc64 is explicitly enabled too; while if 64 bit is implicitly enabled and there is no explicit setting for option powerpc64, option powerpc64 is eventually enabled or not would rely on the default value of the used cpu. It's initially set as the setting for 64 bit, but later if the used cpu doesn't have powerpc64 supported by default, it gets cleared. To keep it consistent with before (also the relevant error/ warning messages), this patch is to allow that powerpc64 can be unset if 64 bit is enabled implicitly, and only stop it from being unset if 64 bit is enabled explicitly. Note that since the behaviors are different for implicit and explicit 64 bit, I failed to construct one solid test case since it becomes fragile once RUNTESTFLAGS specifying -m64 explicitly. BTW, the exposed latent ICE is still there, would be fixed by a separated patch later. Bootstrapped and regress-tested on: - powerpc64-linux-gnu P7 and P8 {-m64,-m32} - powerpc64le-linux-gnu P9 and P10 - powerpc-ibm-aix7.2.0.0 {-maix64,-maix32} I'm going to push this next week if no objections. BR, Kewen ----- PR target/108240 gcc/ChangeLog: * config/rs6000/rs6000.cc (rs6000_option_override_internal): Allow implicit powerpc64 setting to be unset if 64 bit is enabled implicitly. --- gcc/config/rs6000/rs6000.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.27.0 diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 6ac3adcec6b..a9e1a790f28 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -3662,14 +3662,17 @@ rs6000_option_override_internal (bool global_init_p) /* Without option powerpc64 specified explicitly, we need to ensure powerpc64 always enabled for 64 bit here, otherwise some following - checks can use unexpected TARGET_POWERPC64 value. Meanwhile, we - need to ensure set_masks doesn't have OPTION_MASK_POWERPC64 on, - otherwise later processing can clear it. */ + checks can use unexpected TARGET_POWERPC64 value. */ if (!(rs6000_isa_flags_explicit & OPTION_MASK_POWERPC64) && TARGET_64BIT) { rs6000_isa_flags |= OPTION_MASK_POWERPC64; - set_masks &= ~OPTION_MASK_POWERPC64; + /* Need to stop powerpc64 from being unset in later processing, + so clear it in set_masks. But as PR108240 shows, to keep it + consistent with before, we want to make this only if 64 bit + is enabled explicitly. */ + if (rs6000_isa_flags_explicit & OPTION_MASK_64BIT) + set_masks &= ~OPTION_MASK_POWERPC64; } /* Process the -mcpu= and -mtune= argument. If the user changed