From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130075.outbound.protection.outlook.com [40.107.13.75]) by sourceware.org (Postfix) with ESMTPS id 81724384A881 for ; Thu, 8 Oct 2020 12:57:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 81724384A881 Received: from MR2P264CA0172.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501::11) by AS8PR08MB6246.eurprd08.prod.outlook.com (2603:10a6:20b:296::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.38; Thu, 8 Oct 2020 12:57:35 +0000 Received: from VE1EUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:501:0:cafe::93) by MR2P264CA0172.outlook.office365.com (2603:10a6:501::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23 via Frontend Transport; Thu, 8 Oct 2020 12:57:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT050.mail.protection.outlook.com (10.152.19.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23 via Frontend Transport; Thu, 8 Oct 2020 12:57:35 +0000 Received: ("Tessian outbound bac899b43a54:v64"); Thu, 08 Oct 2020 12:57:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5cb5834e829a51e6 X-CR-MTA-TID: 64aa7808 Received: from b2a884e4c2aa.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E9109C7A-00EE-4B47-8725-0CB52DF10CA0.1; Thu, 08 Oct 2020 12:57:29 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b2a884e4c2aa.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 08 Oct 2020 12:57:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g53aKYFlGFp9Ca8rcpKOp9eoL4mudTJQCp3k+7eYCvI10mjvrgVElCxTG7aRyEJPPC556bAmzFkXVPVYgSms8zXvHQoDvkOyHe4iTaReE9Fdv1feQlJZ/7F10sO7pirpcwP2TOzdajZaKU77PHfc2LcBn4myWf2NWKLNMGKUxN4zgDFKG3Wbb8emsTjUHTCLpME6ytfDCi1cowpH/GO8nULhnOqgILeW2adtJ6+6TsYBsVJnCU6219Oob8MZFw0GS2j5Ss3wY71nfWb19IC23tOiPjo6pr/8dnOK05W3sJ0VC+Y6cZdnXFEYCNOjVdi+VP1J0yQ2AKMkH4Tvjn7wZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vyjJEElIUTto2QNuBR/xfK2UktXJuSv3IIg75KbMMo4=; b=lUjq+WefYaNXJ0ifbufn4C9i83KeMgSgR18WL+/26+Kgj/gRIsY5FEvGBvgftJDrxnWN0MrduMQvJzJS+qp3sgwM8BK/7U7AMhXdkv3Xh3i0ZgDjx1g4yR3ci3q65v4wHJDaUB0/lwiW4kjRMPzvXFCPkQz0KG73jFEsRiylk4etDh7poYUq1u67B1ozIed3IbMpb4DLM2aMzZHn7Fx5BZOCcX3yuJaPgCJWkAY7XWodrLOax4skdJ/C0JmWBb9vIS64JQqxtAQANznpt9HKlVB3QGtsA54/0CFIg3cAAsXwQJq9/CDb0b+SFml2NWv5KX6rNLlrY5WBcF1dnRM7vg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from VE1PR08MB5599.eurprd08.prod.outlook.com (2603:10a6:800:1a1::12) by VI1PR08MB2944.eurprd08.prod.outlook.com (2603:10a6:802:22::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.24; Thu, 8 Oct 2020 12:57:22 +0000 Received: from VE1PR08MB5599.eurprd08.prod.outlook.com ([fe80::60b7:2d8b:81cb:bc0d]) by VE1PR08MB5599.eurprd08.prod.outlook.com ([fe80::60b7:2d8b:81cb:bc0d%3]) with mapi id 15.20.3455.023; Thu, 8 Oct 2020 12:57:22 +0000 From: Wilco Dijkstra To: Jakub Jelinek CC: GCC Patches Subject: Re: [PATCH] PR target/97312: Tweak gcc.target/aarch64/pr90838.c Thread-Topic: [PATCH] PR target/97312: Tweak gcc.target/aarch64/pr90838.c Thread-Index: AQHWnWFVWXvlBQpYXUeQ5tIsj46OTKmNjCQAgAAAoAyAAAP0gIAAAhY6gAACHACAABKUWw== Date: Thu, 8 Oct 2020 12:57:22 +0000 Message-ID: References: <20201008110912.GS2176@tucnak> <20201008112535.GT2176@tucnak> , <20201008114036.GU2176@tucnak> In-Reply-To: <20201008114036.GU2176@tucnak> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [82.24.199.97] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1451e1be-d743-4207-5675-08d86b89ba4c x-ms-traffictypediagnostic: VI1PR08MB2944:|AS8PR08MB6246: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: EOUfb7chpmIAujO5oqxv40pzQNqp0OCZg7pEQHG3U+NFcT25MLYWqOQYNOVcfSUWdmasiHbiIvUIRhlY7rCWmJ1SZEjHUIVEn05YhKhNJkt81GuAQme3AeWnNouq7Jiud+Lvjt2HPgdtQBfWevrHP0d3Rm4V+gq/PrTvLKjNh1aRWWOZEYKqr/Gqc5MkASz7YyAChnR7nK9fvK5srybHV6jpb17osCb5CZiYh8FI68N+Tx3FR/RccIKjfnYE4nMvjbn+jLU5+DUryIROzds0LQQt/YzmnrOovNtMB3o8pdTOz4esUaetA3716TrSslq1 X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB5599.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(136003)(346002)(376002)(396003)(366004)(91956017)(76116006)(8936002)(478600001)(4326008)(66946007)(64756008)(66446008)(66556008)(66476007)(55016002)(7696005)(8676002)(186003)(71200400001)(6506007)(86362001)(26005)(316002)(5660300002)(2906002)(6916009)(9686003)(52536014)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: iJe59nPveH2caCZJL4rpGlYGRqtDRAWCIxuhNpsTp4sGlRNtOF8ivSCiHoHejPeHWfrGgauiuan1nrG5ktL7yhhjvaiDJIZq3NetscW+3Ecz+cdU7nxOH+WYb4dYTsR9yGjUK2X+Do9NJVW+/UBzqyuNcNi0D2z3MTG0RayKgpZcNp6dbCsI8IAgnTyVUS90e997v/UUQZB7YuPaIcxS2yudzbVUFlGP9V+viiXC26y/mOn72vQa30E7SLveS5Qz/Fi76JtFNQ6kiUHngERFXh0TpmZN8kBTYxF1ide474ehtlEwcS7EGU4vTlTeaCu8rx/N4fZwR1iOxNkKWFquTukOSIO6XIvW2/swzRweiGfgZrDGdxcgUoHoV2wm9qhROLxiGMaXs8eLiLJJsDXmudolkl54z0qEYxTF1eB0P6LqSgi03W2uVpuPXdpuiAoccgiGPpRTuHM5tc/SzgI5Hk08Q6GaSc8Em/ah5ZA8NQ011u7CWxc5gFqsyFu1LaCeQRNFXwOXePON3OC/3povvIis3kUlOLanfDP2PJZmI9A8NFNRoaDAAcpC+WR4ec06x+gC6w0mtKtSlIk3Ev0DJQxtK9dmtH8lkTOkSufSt+pXXlglUBLiN4lDKkmA9THhX3VDQXLVYQPiismZRlnX5g== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2944 Original-Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 505fcc0b-b8fe-413f-6a15-08d86b89b29a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9Zjs8ArWaTktbHyFu7SJDdTYsxI9kEVRmurIer4HZWM7KTlquSUHS2Z3M641DeLKvSv0ah+O8MLfsRnDftoX2R8AOYm1XU46dZksu34Es2rkB13giPDvfcHIHPwdOBxye6825+cMtOdDtVGDfNBeGet5sy5xPYJ6kS5XCCbKB/l15C9An6d4WJON+P5yEYm2FzSMXDTMoCuuvo5KquGq6Sck9R6qbXj9+acEQyxtsKAQXdp87o6tSUKV2BGi/bh0/uqqtx2XcbmfwNi6O8h+VKaoeUAClwkA2vf8YRuwu2h88ILB3tT0sLxQ/DtxMKmhh6OOSrkNrxdooyHph4Q5YxQUVL942d1YoS+2iuRSOTRE4X+GC9rj4rGX4bznlABhwoqRZvDh7FhFGjIC6lDPYQ== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(136003)(396003)(39860400002)(346002)(376002)(46966005)(26005)(186003)(52536014)(7696005)(36906005)(82310400003)(8676002)(6862004)(4326008)(6506007)(86362001)(5660300002)(316002)(81166007)(2906002)(356005)(9686003)(8936002)(55016002)(70586007)(336012)(47076004)(33656002)(478600001)(82740400003)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2020 12:57:35.1692 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1451e1be-d743-4207-5675-08d86b89ba4c X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6246 X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Thu, 08 Oct 2020 12:57:39 -0000 Hi Jakub,=0A= =0A= > On Thu, Oct 08, 2020 at 11:37:24AM +0000, Wilco Dijkstra via Gcc-patches = wrote:=0A= >> Which optimizations does it enable that aren't possible if the value is = defined?=0A= >=0A= > See bugzilla.=A0 Note other compilers heavily optimize on those builtins= =0A= > undefined at value zero.=0A= =0A= You mean the PR94801, PR94793, PR95863 you mentioned before? The first does= n't=0A= seem to be a useful optimization (would anyone ever write that?), the other= 2 would=0A= benefit from clz(0) being well defined. In particular, x86 without BMI woul= d greatly=0A= benefit from setting CTZ_DEFINED_VALUE_AT_ZERO to 2.=0A= =0A= So I fail to see any "heavy" optimizations here that show a benefit of keep= ing the value=0A= undefined at zero.=0A= =0A= >> > We just should make sure that we optimize code like x ? __builtin_c[lt= ]z (x) : 32;=0A= >> > etc. properly (and I believe we do).=0A= >> =0A= >> I think we do, but both the external and internal documentation are not = clear=0A= >> enough that most targets actually do define a value and will optimize fo= r it.=0A= >> Otherwise we wouldn't have this bug now...=0A= >=0A= > The documentation is very clear that the builtins are undefined at zero,= =0A= > that is all that matters for users.=0A= =0A= If we don't change the undefinedness, at least we should try to explain the= above=0A= idiom as a way to get a well-defined range that still results in a single i= nstruction=0A= on most targets.=0A= =0A= Cheers,=0A= Wilco=0A=