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 661803858D37 for ; Mon, 10 Oct 2022 02:16:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 661803858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29A21YZ7003624; Mon, 10 Oct 2022 02:16:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=BTRBx3ECuzEQNH/kfO8oUojIuFXB+RjgaJOY//lBy0g=; b=svqj+LfDmk5gozLt4lSM4uhEhLeXri3eyetabiOQhzFk+/fQPyR9mZfq+65u6BlDhNXN QmsicJWcaD+c4jIZLWM1XfMix7gKMNePa6CH0c+DadjW2H+2n4mx5zQZA9xcR0CxxZyQ rE2EBGdk7FGGEyHtmiqsHFPY+e9I/mlxeo2PZlX9u33SBYH8q7KS08bJQON8+LRI6Qu5 8X/7P8UBNbG+btTuWv/nJIl1kNulajSgjCD0emX1KADF8BbJK1ZDQxDF8qBGNwlhXCJZ TxnTzIGlUWxcYyrUVa6ZoACIz9JiQYYJTKEOS2i50QN5zFNvpkGgcZoBWLsI4dYT03QH nQ== Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3k3jvke5kj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Oct 2022 02:16:06 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 29A26x38009902; Mon, 10 Oct 2022 02:16:04 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04ams.nl.ibm.com with ESMTP id 3k30u9a386-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Oct 2022 02:16:03 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 29A2BLfw48038202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Oct 2022 02:11:21 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A2244AE053; Mon, 10 Oct 2022 02:16:01 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 63A92AE04D; Mon, 10 Oct 2022 02:16:00 +0000 (GMT) Received: from [9.197.240.216] (unknown [9.197.240.216]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 10 Oct 2022 02:16:00 +0000 (GMT) Message-ID: Date: Mon, 10 Oct 2022 10:15:58 +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 Subject: Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680] Content-Language: en-US To: Segher Boessenkool Cc: Iain Sandoe , GCC Patches References: <9d9f1f43-b528-387d-45a7-1d89400de0fc@linux.ibm.com> <5B4DCBBB-3237-4A9F-ACCA-6669DE6905B8@sandoe.co.uk> <92415AC8-4A5A-4119-BFCC-D7C66472F961@sandoe.co.uk> <5e64fed0-7e79-3d60-da62-5c2bf3e2c707@linux.ibm.com> <20220929171100.GY25951@gate.crashing.org> <20221003211530.GQ25951@gate.crashing.org> From: "Kewen.Lin" In-Reply-To: <20221003211530.GQ25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: _vnUBeeI21MwBewt5SWtSfXb0Wx01BFy X-Proofpoint-ORIG-GUID: _vnUBeeI21MwBewt5SWtSfXb0Wx01BFy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-07_04,2022-10-07_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 bulkscore=0 clxscore=1015 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210100011 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,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 List-Id: Hi Segher! Thanks for the comments again! on 2022/10/4 05:15, Segher Boessenkool wrote: > On Fri, Sep 30, 2022 at 08:15:37PM +0800, Kewen.Lin wrote: >> on 2022/9/30 01:11, Segher Boessenkool wrote: >>>> +#ifdef OS_MISSING_POWERPC64 >>>> + else if (OS_MISSING_POWERPC64) >>>> + /* It's unexpected to have OPTION_MASK_POWERPC64 on for OSes which >>>> + miss powerpc64 support, so disable it. */ >>>> + rs6000_isa_flags &= ~OPTION_MASK_POWERPC64; >>>> +#endif >>> >>> All silent stuff is always bad. >> >> OK, with more testings for replacing warning instead of silently disablement >> I noticed that some disablement is needed, one typical case is -m32 compilation >> on ppc64, we have OPTION_MASK_POWERPC64 on from TARGET_DEFAULT which is used >> for initialization (It makes sense to have it on in TARGET_DEFAULT because >> of it's 64 bit cpu). And -m32 compilation matches OS_MISSING_POWERPC64 >> (!TARGET_64BIT), so it's the case that we have an implicit OPTION_MASK_POWERPC64 >> on and OS_MISSING_POWERPC64 holds, but it's unexpected not to disable it but >> warn it. > > Right. If If mpowerpc64 is enabled while OS_MISSING_POWERPC64, warn for > that; > Currently if option powerpc64 is enabled explicitly while OS_MISSING_POWERPC64, there is no warning. One typical case is -m32 compilation on ppc64. I made a patch to warn for this case as you suggested (btw, this change can be taken separately from this rework), it caused some test cases to fail as below: gcc.dg/vect/vect-82_64.c gcc.dg/vect/vect-83_64.c gcc.target/powerpc/bswap64-4.c gcc.target/powerpc/ppc64-double-1.c gcc.target/powerpc/pr106680-4.c gcc.target/powerpc/rs6000-fpint-2.c It's fine to fix them with one additional option "-w" to disable the warning. But IIUC one concern is that if we want to test with "--target_board=unix'{-m32, -m32/-mpowerpc64}'", the latter combination will always have this warning, with one extra "-w" (that is -m32/-mpowerpc64/-w) can make some cases which aim to check warning msg ineffective. So maybe we want to re-consider it (like just leaving it as before)? > and if mpowerpc64 was only implicit, disable it as well (and say > we did!) But on ppc64 linux, for -m32 compilation mpowerpc64 is implicitly enabled since it's with bi-arch supported, I made a patch to disable it as well as warn it, it can't be bootstrapped since it warned for -m32 build (-Werror) and failed. So I refined it to something like: + /* With RS6000_BI_ARCH defined (bi-architecture (32/64) supported), + TARGET_DEFAULT has bit MASK_POWERPC64 on by default, to keep the + behavior consistent (like: no warnings for -m32 on ppc64), we + just sliently disable it. Otherwise, disable it and warn. */ + rs6000_isa_flags &= ~OPTION_MASK_POWERPC64; +#ifndef RS6000_BI_ARCH + warning (0, "powerpc64 is unexpected to be enabled on the " + "current OS"); +#endif BR, Kewen