Message ID | 20240313143823.1864-1-Joe.Ramsay@arm.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> 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 EDC0E3858C3A for <patchwork@sourceware.org>; Wed, 13 Mar 2024 14:39:20 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2074.outbound.protection.outlook.com [40.107.14.74]) by sourceware.org (Postfix) with ESMTPS id C4ECE3858C3A for <gcc-patches@gcc.gnu.org>; Wed, 13 Mar 2024 14:38:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C4ECE3858C3A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C4ECE3858C3A Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.14.74 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710340726; cv=pass; b=bP0pHexop8zbKQlFBx3so7LYEfn36fePFChZy7w2PLVoGUZbtWbrtZxY3URb7a2+W8TnS0mK1n5nt/1nENnaSMIEkIf6J52If2GBb2vJCiAGV35IZXLFGbj211knu/naAU9SgapxU7/qqZ72zA1ym2XzeVziZJ9VM3QIx43ytO0= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710340726; c=relaxed/simple; bh=oqxbm0QRP0AtnCfxWpfqSbd9jbqtY4jpjrVanyF9OgE=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=FL7rNyEnrFXKAJTNhILsK/mtlowfgab4+k8q+uDSvkEHQL7sA9ndpDltgw7p5qDpmft1cTkSbNVkMRodRlIXSki8ZsQB0X1Z/d3ptKQoI6Xy/UtaZBZy7FkkDMFpe6nJQuw9aOimkS2bUoYhUawtORKS0XmE6f4U2LA1Sp9hueg= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=gRcU0GiKcJ7SwNCFEBkJDIU1XGvO95P5zCikcnJCKuahVrSIFYZOSd/hVZpW8ycGnvPTe6X9xv5w/GvqLsUVDJnaMhtTuJMDeVpDp8hR94SOvHxRyVhRBmee2t5qr0XkFy+9LErBdv9i2U3gWMvjyuaZlnvGnOvanjsckOe8UcP/j/OpRwHNYZi/OjfJmV+62gCNWXjDATPKRcZ6HwUDREWVReZ4yMYvcjDiaX3r7kKigD8w9p+D5gDaJqQeHEyJZp0+ScS7cJiJdUB2zRMAVNA6n9wDGU57X6r0xFCSvD/gtIMMdVhIjHHQ0IQrmnXxFBRJBQtnPcoRbNYKit+mbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/52ZqVS2tMuYX7Sjm/rrH4UhARlbLv1CpahvTe2/Yx4=; b=bUOzRSS0hJ0t6uI7dGAirHS7VJYBZmAL6DLNTAC9GBizMHU0HWm+GzBkOGvoFNXIV+vgaHTboYVHPTaykNGV/EHD58/aySaA1Gr67AdHFy+IRBLFMRE1m4C1Vfzy01xPx8GnwvsbyKGpaYpPM5nNR7fme3pHVUezlwsTQzLRUFuAU23YwFblt0JOrxmWADRj3QsbgDxQXH+YGH4WbZkvp+bv9f4d1WyZnBtKJBNlrS9n6Y+OOAMMZLSS9mgiLa7dmRgjF8eY+SZeCBtdHbYYuaoLwfSLJ89Vyu9CUNmlij3h7WS/ajx6DUFLwXXU+gUhiKcsUYNT3gN5cWIjg5JrcA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/52ZqVS2tMuYX7Sjm/rrH4UhARlbLv1CpahvTe2/Yx4=; b=cgTUyIhfyQF5vQgVqTj4zPBepELXg5QIEKLxU5GlNITfV1VFQubDw5JMVwhfhsAb+lH3E/Peptx1W1d9LpnmLuwhcDLSW9TG4yJPSLJwXlWF2Y0VTiKGrwT4DLASwEGxPomXDi7Y57F1MuCluOqjyWwdHAXXe55ZsFUR+9LvGWs= Received: from AS9P194CA0012.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:46d::31) by AS8PR08MB6597.eurprd08.prod.outlook.com (2603:10a6:20b:334::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36; Wed, 13 Mar 2024 14:38:42 +0000 Received: from AM1PEPF000252DC.eurprd07.prod.outlook.com (2603:10a6:20b:46d:cafe::24) by AS9P194CA0012.outlook.office365.com (2603:10a6:20b:46d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36 via Frontend Transport; Wed, 13 Mar 2024 14:38:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM1PEPF000252DC.mail.protection.outlook.com (10.167.16.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.12 via Frontend Transport; Wed, 13 Mar 2024 14:38:42 +0000 Received: ("Tessian outbound 5fdc1e2b2c35:v276"); Wed, 13 Mar 2024 14:38:41 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0f0fcee3af639259 X-CR-MTA-TID: 64aa7808 Received: from eeaea004fa88.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 64813A8D-8E04-43D2-A017-E901845DB3DE.1; Wed, 13 Mar 2024 14:38:34 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eeaea004fa88.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 13 Mar 2024 14:38:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lQ5aKTIG7X0qyrueLLoNd0s0+XkoxputeLxYUrj5sCTQWtclXexVcrZWZKg3BiF+3eX9KrT/EkpAzAZw6cNm6MQ4BQBCGQxnHADgBMBgGY55PSlx8jtgad4RJF3JMa2lnEv/I7hApH2hlImM5dPSexbTfRZQJbG0y41ZsQREi8LIJWKtzpHaB1ajF+YPZy6K9YW7MkiK4F6cP3R9GibhIwX+E1oAnXKxgMOBom0Da9rgSfBrOdhBZoF3Vtqz1gcY0K7dRq5onVSAdxSzaDJdXnxrcdrwX9DYE/ZoEGVHyaqTkFx2hYn9D9BJeWIfsxt5fitxHUV+P/Fk2tKcYA2iEg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/52ZqVS2tMuYX7Sjm/rrH4UhARlbLv1CpahvTe2/Yx4=; b=kkONUZzkZVfr4yD/pmpDJYkbGC8ucKQhIRDVxJMz649iz2fw+o/cdtrA4ezamMOuTazmuhID310aevftk0CQKrDa2hIc/qVmCTy7JC1Uzlwj64k7G0Q88fV7+PVBkUtLqHE92BPvQRNF3NimdBWVRNnhbPRnvpvzpq4e8SVlg4g+np5iUBdMGMMjKzwAVppUsZngeg0x1NwWwQAVFLYMVMAgpR9N7mk7u0EY1SD6CXqAhZsNxJujqIQhfcEpdebNgqB4jhNfdECptfy0UPTXIrdQfqSY8Zq81awI8si2DfC+4MOqTz1ZZOZD/LAw7g5RfkITgU+LAb3HJnePNkOxMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/52ZqVS2tMuYX7Sjm/rrH4UhARlbLv1CpahvTe2/Yx4=; b=cgTUyIhfyQF5vQgVqTj4zPBepELXg5QIEKLxU5GlNITfV1VFQubDw5JMVwhfhsAb+lH3E/Peptx1W1d9LpnmLuwhcDLSW9TG4yJPSLJwXlWF2Y0VTiKGrwT4DLASwEGxPomXDi7Y57F1MuCluOqjyWwdHAXXe55ZsFUR+9LvGWs= Received: from DB3PR06CA0033.eurprd06.prod.outlook.com (2603:10a6:8:1::46) by DU0PR08MB9873.eurprd08.prod.outlook.com (2603:10a6:10:421::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19; Wed, 13 Mar 2024 14:38:31 +0000 Received: from DB1PEPF000509F5.eurprd02.prod.outlook.com (2603:10a6:8:1:cafe::e9) by DB3PR06CA0033.outlook.office365.com (2603:10a6:8:1::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36 via Frontend Transport; Wed, 13 Mar 2024 14:38:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DB1PEPF000509F5.mail.protection.outlook.com (10.167.242.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7386.12 via Frontend Transport; Wed, 13 Mar 2024 14:38:31 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 13 Mar 2024 14:38:30 +0000 Received: from vcn-man-apps.manchester.arm.com (10.32.108.22) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Wed, 13 Mar 2024 14:38:29 +0000 From: Joe Ramsay <Joe.Ramsay@arm.com> To: <gcc-patches@gcc.gnu.org> CC: Joe Ramsay <Joe.Ramsay@arm.com> Subject: [PATCH] match.pd: Only merge truncation with conversion for -fno-signed-zeros Date: Wed, 13 Mar 2024 14:38:23 +0000 Message-ID: <20240313143823.1864-1-Joe.Ramsay@arm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB1PEPF000509F5:EE_|DU0PR08MB9873:EE_|AM1PEPF000252DC:EE_|AS8PR08MB6597:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ec30c21-8e05-4aa4-30ad-08dc436b479a x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 7xw+wyMI/LuF6LjPYkzrObS9gzSNUNwSscInet5JKiLtcs5o91hS/i/D1RoTU+DHNfYlqMk+LNy81PflWc1oGUCdvjEM/pE+DeUFQxw4AXSMldiihGnGUbldWb9/mWwY7JZ5A74yn5J6OdtHgc+XUP0vCqr1rWhmdPNStkqt9GXrbcCHdtO2GZ9mnSJRVaROqbw4Vc62W2DQTA98Uchh2TA0xIeVu3UlHQfJpThvQbAL0bIawgkR7OY0YXZ4ocWpJrk+odvY+Y6Lw+rW0E5QDHtjN4Gs1ufrAteAB461bQ4rLNufyXC9Wtsb4IK2F3u0FrcQrJtrFlNjfMhBGLRnqi3MJ56YkfD+RVehoxeEc24/iyT4s2q/xviXqRxN2hQl/g7kvq4NMz1Gi+WujUzahhAZIZGkmbBMa3Y6JTurZwXrw/CuVYCCjgFmp+oDMK5h8n3vQR78EVxUKfuDjFaSmC3I9sSboMIrXV6Yb5nvdAc2yUPLaW0lzKA78ndFyrSU/i0m9xqKumcbPuQHN0UEiewlIghkTuHErm/8d5BQfhElgWEYBiGOqj17QFm5ZW6Su20wqkPNXp8kMxEgzud4N2wsltR2yn8ygnXATTUdXmGreVm0ukVn/INjvFL/3TSay/dQxiBhUePtMbEqs0kEouRKRx0nmqi7uuTIR72KO5z1ongywviNsvoboAw6gF8vX9MApmCxDlcOElPGlr1/Jg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(36860700004)(1800799015)(376005)(82310400014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9873 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM1PEPF000252DC.eurprd07.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9d266d4d-647b-43c2-bfa6-08dc436b4126 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: edqMPKwFyMaTrQz3/+rP7GLpvYGtpCQqxLLWXAIOIg5cEN1Kvy+hxkhqoed6xFlSh69MgX7yuwwMA48zCk9qKxItbGAG3o5kfHXkz5fl8DxZOQbwyA21/MAHfCJgOdcXN4ev++fLGyPDfYFlO3ZXGaXlQtQjAM5O4moICJKr4kdD66EFOF+iw2Ply16oSUuaf9MqpyOJh6MO3iv+6pQU8iee5gAgckIiTke0nsDFLPPWJTWNvPI9ovElbC9SxYeHulx+GD1sLmCBx45KBnG/xxqTB/DhWxz0uG+6zgtYpkTSqsl9UzZv7Uh/wPArUY7KxLUOpJ7aOkjrjgAnwkGaipO7tvPqMDWkv4txxI7QhFsBF9RCVialKh2gLrRoqNsaSA1A8hUnDYM+3aRZk22QwsbFEF+2vcxiyGiAAdfSWJMgqKT2oO3xrlGptU62cQU4SIIyNl8dg+EWHWJguLv8fhm3Tk0YAwVlDiAI30juEJ9q1r4yaZF4jlonLMIBP+MQTiCD6prRSvnsyOAuaMIWSxhAyivRwxIb8J0vGYjL0OeFpKxKjCLEPDKMpVs8XIlfw6EScFhqF6Wgbb0WpQetXm04AR+XqkiNjtd0LRm0HGTc92U5mehwVLWxas6KNe4RagHZYLbY4Cuz+FWEgLJdcN/09ST2UJnIN+bFF1+fDfUfBgsJoc5rY/+zqDBrl/7py+S1REkGHH/jnVZeJOsMNQ== 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:(13230031)(82310400014)(36860700004)(376005)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 14:38:42.0835 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1ec30c21-8e05-4aa4-30ad-08dc436b479a 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: AM1PEPF000252DC.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6597 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org |
Series |
match.pd: Only merge truncation with conversion for -fno-signed-zeros
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gcc_build--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_check--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 | success | Testing passed |
Commit Message
Joe Ramsay
March 13, 2024, 2:38 p.m. UTC
This optimisation does not honour signed zeros, so should not be enabled except with -fno-signed-zeros. OK for master? I do not have commit rights for GCC, so if the patch is fine would someone be able to commit for me? The bug is present in all GCC versions from 12.1.0 onwards - is it possible to backport this? Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Thanks, Joe gcc/ChangeLog: * match.pd: Fix truncation pattern for -fno-signed-zeroes gcc/testsuite/ChangeLog: * gcc.target/aarch64/no_merge_trunc_signed_zero.c: New test. --- gcc/match.pd | 2 +- .../aarch64/no_merge_trunc_signed_zero.c | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/no_merge_trunc_signed_zero.c
Comments
On Wed, Mar 13, 2024 at 3:39 PM Joe Ramsay <Joe.Ramsay@arm.com> wrote: > > This optimisation does not honour signed zeros, so should not be > enabled except with -fno-signed-zeros. > > OK for master? I do not have commit rights for GCC, so if the patch > is fine would someone be able to commit for me? The bug is present > in all GCC versions from 12.1.0 onwards - is it possible to backport > this? > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > Thanks, > Joe > > gcc/ChangeLog: > > * match.pd: Fix truncation pattern for -fno-signed-zeroes > > gcc/testsuite/ChangeLog: > > * gcc.target/aarch64/no_merge_trunc_signed_zero.c: New test. > --- > gcc/match.pd | 2 +- > .../aarch64/no_merge_trunc_signed_zero.c | 24 +++++++++++++++++++ > 2 files changed, 25 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/gcc.target/aarch64/no_merge_trunc_signed_zero.c > > diff --git a/gcc/match.pd b/gcc/match.pd > index 9ce313323a3..45c34c810cf 100644 > --- a/gcc/match.pd > +++ b/gcc/match.pd > @@ -4857,7 +4857,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > #if GIMPLE > (simplify > (float (fix_trunc @0)) > - (if (!flag_trapping_math > + (if (!flag_trapping_math && !HONOR_SIGNED_ZEROS(type) put the && to the next line and add a space before (type) OK with that change. Richard. > && types_match (type, TREE_TYPE (@0)) > && direct_internal_fn_supported_p (IFN_TRUNC, type, > OPTIMIZE_FOR_BOTH)) > diff --git a/gcc/testsuite/gcc.target/aarch64/no_merge_trunc_signed_zero.c b/gcc/testsuite/gcc.target/aarch64/no_merge_trunc_signed_zero.c > new file mode 100644 > index 00000000000..b2c93e55567 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/aarch64/no_merge_trunc_signed_zero.c > @@ -0,0 +1,24 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2 -fno-trapping-math -fsigned-zeros" } */ > + > +#include <math.h> > + > +float > +f1 (float x) > +{ > + return (int) rintf(x); > +} > + > +double > +f2 (double x) > +{ > + return (long) rint(x); > +} > + > +/* { dg-final { scan-assembler "frintx\\ts\[0-9\]+, s\[0-9\]+" } } */ > +/* { dg-final { scan-assembler "cvtzs\\ts\[0-9\]+, s\[0-9\]+" } } */ > +/* { dg-final { scan-assembler "scvtf\\ts\[0-9\]+, s\[0-9\]+" } } */ > +/* { dg-final { scan-assembler "frintx\\td\[0-9\]+, d\[0-9\]+" } } */ > +/* { dg-final { scan-assembler "cvtzs\\td\[0-9\]+, d\[0-9\]+" } } */ > +/* { dg-final { scan-assembler "scvtf\\td\[0-9\]+, d\[0-9\]+" } } */ > + > -- > 2.27.0 >
diff --git a/gcc/match.pd b/gcc/match.pd index 9ce313323a3..45c34c810cf 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -4857,7 +4857,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) #if GIMPLE (simplify (float (fix_trunc @0)) - (if (!flag_trapping_math + (if (!flag_trapping_math && !HONOR_SIGNED_ZEROS(type) && types_match (type, TREE_TYPE (@0)) && direct_internal_fn_supported_p (IFN_TRUNC, type, OPTIMIZE_FOR_BOTH)) diff --git a/gcc/testsuite/gcc.target/aarch64/no_merge_trunc_signed_zero.c b/gcc/testsuite/gcc.target/aarch64/no_merge_trunc_signed_zero.c new file mode 100644 index 00000000000..b2c93e55567 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/no_merge_trunc_signed_zero.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-trapping-math -fsigned-zeros" } */ + +#include <math.h> + +float +f1 (float x) +{ + return (int) rintf(x); +} + +double +f2 (double x) +{ + return (long) rint(x); +} + +/* { dg-final { scan-assembler "frintx\\ts\[0-9\]+, s\[0-9\]+" } } */ +/* { dg-final { scan-assembler "cvtzs\\ts\[0-9\]+, s\[0-9\]+" } } */ +/* { dg-final { scan-assembler "scvtf\\ts\[0-9\]+, s\[0-9\]+" } } */ +/* { dg-final { scan-assembler "frintx\\td\[0-9\]+, d\[0-9\]+" } } */ +/* { dg-final { scan-assembler "cvtzs\\td\[0-9\]+, d\[0-9\]+" } } */ +/* { dg-final { scan-assembler "scvtf\\td\[0-9\]+, d\[0-9\]+" } } */ +