From patchwork Fri Jan 19 14:00:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Coplan X-Patchwork-Id: 1888497 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=BPaFcerD; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=BPaFcerD; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TGhBC2pBTz1yPv for ; Sat, 20 Jan 2024 01:01:54 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B7EE3857C65 for ; Fri, 19 Jan 2024 14:01:52 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2086.outbound.protection.outlook.com [40.107.247.86]) by sourceware.org (Postfix) with ESMTPS id D18373858D28 for ; Fri, 19 Jan 2024 14:01:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D18373858D28 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 D18373858D28 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.247.86 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705672877; cv=pass; b=Tr2igtCJ9wkZH/MqK8LpkbjPcNmsLmRJGKqqZmgaqDr/3rD7xKmXY+Rf3D14jdzesQPUXR/wNgE/n3rj/JRzoWHYIXPcgT27jSoT/Hzr0I2kzi5RHmPuvNDa58oeHTdaxA2Kzo/hDE9Kyi2v2QWfONhq6kgGVf23jGV3nuP+cek= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705672877; c=relaxed/simple; bh=IsHPcjxxHaPL6Vx1KdZ6+JYVgo+bl4I9u+tMl+8iT80=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=bGpsF/uBVBD3LJwL7/j2NbIh+48F5XEGEbufS4seh7YqDoCyJIoF2WimjCgVEz4E+cLU+TuPhcQSDq0lme077ldm2qOBWjsSq/kATgyMDDEYqpuxjivlUKnS873nVRvy5JQH79g7zcswMfwdg032bTgFy6qHNZ9L1trRARFyaU8= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=dhTn1hf35+ZdTaYC5+1JXY3sdo7UPDAxrRmfneY/HqJ7jF65JY5jS74gxbX9ILJ/+GvlTwv2vbEnAtv3ZcdSohIq77tXIDoOzvQC21WP5Mj21D8CdDWlRaOxarNneDpt4VOpSxsSG/Iz1UpsYFyqEYkwTjsWtpTZb8UHdHh8SCP47K8p2nB1uvaQJ28L1KX1TbiuK1/bGdQ6odcHcYN2+JT3ay84LCLcEn6qcgEOpKi0HbR5lXLyEp4WvQctW1AEb7sWC/vTBGVBBOELX0ygaA8NIv/HmHGfyMOGIzwiBOC9z0AXEonkoMuXQJxuroQVQQ7neQJrpVTtU6noSvHIMw== 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=qVJcH+n+kniMwc8wpc5O1BXFAyVydteWzaraH73kFfU=; b=YZqSI8skrs32oT4oKtIWUvq5rhk5KHFMGOdcxfGPOglWjcY+2iv4Cv6Z+5XC1ozOdiqbS7KtHyiYv4gQZ1d8nmwZ9WiPomjSPtXVinkyFQujl6QCepKUECMSMJcrPV6lfBw5QzIHPwf4EPXtkp8vaW7SXvnB9fD/DPi30RUURN5mLpbXYCBcl0TLAaqQaidR/UIk/hwZ9/z+ffBpFLb3jAskk8qLn3LOTGqBrs9zdAosZE0bvQroFLngrTqYFi2tb8JGkJh1oVJ59CcsJnLQjd56dbWrXYzkqquXn7VDGMj/e7a+ykX/vWxRLuI+lpEqSxaP9pIFvCV08HfKVL0png== 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] dkim=[1,1,header.d=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=qVJcH+n+kniMwc8wpc5O1BXFAyVydteWzaraH73kFfU=; b=BPaFcerDHlTPRaWFfdU2aQnglqxVUPwCTrARgr5KIXpkVClH885Ssk1PS66KMHp8WMogBi52Id3ij0JhLoWXt1lFP7CI7gmPiO2ULnS8YYj6hfCCckq2AE4iOtaZO0xlHbYhGJwClMp58ldLztYo1GzJUBXfsbfyt1qlfFgEtBU= Received: from AM6P194CA0014.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:90::27) by DB4PR08MB7936.eurprd08.prod.outlook.com (2603:10a6:10:378::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.24; Fri, 19 Jan 2024 14:01:10 +0000 Received: from AM3PEPF00009BA0.eurprd04.prod.outlook.com (2603:10a6:209:90:cafe::98) by AM6P194CA0014.outlook.office365.com (2603:10a6:209:90::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.24 via Frontend Transport; Fri, 19 Jan 2024 14:01:10 +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 AM3PEPF00009BA0.mail.protection.outlook.com (10.167.16.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.16 via Frontend Transport; Fri, 19 Jan 2024 14:01:10 +0000 Received: ("Tessian outbound 67699c3f02bc:v228"); Fri, 19 Jan 2024 14:01:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fb786ca6f4761108 X-CR-MTA-TID: 64aa7808 Received: from 0d2c04e89ea0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E11D6C54-59F4-4E26-BBFF-98FE5F0E1C07.1; Fri, 19 Jan 2024 14:01:02 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0d2c04e89ea0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 Jan 2024 14:01:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EHGCGBiAhAC+OKgggIO1QqlLDf+FbM9kpD4BAXn+SrgTL9N9EO/hn7G7+xr1RMY856vL92CLW4kFWh/ROyYNPKaHtg3Cxt+tM77nOFPh82VBT1j4l00fM0VoVwsOqC22tdCWop/wUO+3X3XbslU3NbmOgatCCYqpi7wGsCjMAkUpTmwz5JS3jLIxz8k/+HGOqiwR+PqKx48a9nlI6QYhbeh6yuGq4O/iC3hIHyzQTDIZVlulIpZVvlpBBIvebYrljnlcBHbAkJPkk/XmguA+Sr8EjDEcJGRmgoXsqRG95D2/C/w/7+UY8U44LSnPlDqtNXP6l0FODDwoZG10xMhZhQ== 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=qVJcH+n+kniMwc8wpc5O1BXFAyVydteWzaraH73kFfU=; b=mUGo61tp5GR7b1ZEWz5a5OO6yLZfgy3aYrtSuH6qxSYlAzQQxPfdMaWdmYYOWdb4Wlo5POqvpHSgSmhAFBiZ/hZreTm591b+oRqjedTXXzIWHFDloQRl0MhweIIYVduq/Ne491gVTfU6Tvhoxngbe7Oe3n5gLAGtUVf7P4Kktc9UIV87VzsQzViYrWkWQXrUsto83h9sdmSX1BdBYsaJlJqnRWgeritwdYdGaT6qFwVKRj/54jrKzqvMJCuoZI+0YdMB4TNfjBgYRCdu5DxMhyUmVmgn0asTNvc3s+4DkB/YZamff44oX9EdLBN6+M2hlLsbyJ5MD4sUfUNSN60k6A== 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 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=qVJcH+n+kniMwc8wpc5O1BXFAyVydteWzaraH73kFfU=; b=BPaFcerDHlTPRaWFfdU2aQnglqxVUPwCTrARgr5KIXpkVClH885Ssk1PS66KMHp8WMogBi52Id3ij0JhLoWXt1lFP7CI7gmPiO2ULnS8YYj6hfCCckq2AE4iOtaZO0xlHbYhGJwClMp58ldLztYo1GzJUBXfsbfyt1qlfFgEtBU= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) by DB9PR08MB7582.eurprd08.prod.outlook.com (2603:10a6:10:306::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.24; Fri, 19 Jan 2024 14:01:01 +0000 Received: from PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::48ca:fbcb:84bf:ed17]) by PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::48ca:fbcb:84bf:ed17%4]) with mapi id 15.20.7202.024; Fri, 19 Jan 2024 14:01:01 +0000 Date: Fri, 19 Jan 2024 14:00:56 +0000 From: Alex Coplan To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw , Richard Sandiford , Kyrylo Tkachov Subject: [PATCH] aarch64: Don't assert recog success in ldp/stp pass [PR113114] Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P265CA0053.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ac::19) To PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PAWPR08MB8958:EE_|DB9PR08MB7582:EE_|AM3PEPF00009BA0:EE_|DB4PR08MB7936:EE_ X-MS-Office365-Filtering-Correlation-Id: cb493e9e-f9fa-4060-0fe0-08dc18f716f1 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: hFcQm/hUSG4KoMl7fvW/EjfPCc0IG5J4xKQ11YEi1VVoEOq9fCItENtVrEZLKhT6h3yH5iSYZaN1ivaOoHopE+lT0cPzpaLR1UK4DydDq6Fl64bn4DeSYkPRxSqrxJVT7JHco7uEUueix5Een/J3jizoVUc9YXnzCvAOVrPBR5RkRjEMFWBYMcLsbyH9Y8uxMJnErlunjJj7P9t8PtTtIXMCt19Qot76oC00hvdJTOrAwVXzH0sB8oiyy0i80sC4M/u7pYmB01uNiCzjp3PC9akRh8iIr5NHH8pkWG0sSfny0zv9l5R3CMTZQs6If/h9BkFWqSQTDnjSKyaNRWWw7y4UcbnrSjIn+5btnTKqkq/LDzrR9yNGYUsEmL36Wk0j0UTOCe2gS4PMzWwED+YkUzoN97Br4OEO4lT+BNvKq8O4iVXvW+AYb3ulGqMt85+hAlWWbRntO3iEpyi9xxwHAxHKrnCGPwSiO5kYx/B1iY+obISC04P1KB4lGLWdnbTn2kpqZCk73zr6k2Mcf1shKBMepXmpVcAHmKrj8LqhT8xY5xjeF7jcnfuqBqWOmaG1As0DJ3MvTB3d7G+M77R3uW7N56xmRW1ROf02Mz4O35k= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAWPR08MB8958.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(346002)(366004)(136003)(376002)(396003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(4326008)(44832011)(5660300002)(235185007)(2906002)(6486002)(54906003)(316002)(36756003)(8936002)(8676002)(6916009)(66946007)(66476007)(66556008)(38100700002)(2616005)(6512007)(86362001)(478600001)(44144004)(33964004)(6506007)(26005)(6666004)(21480400003)(83380400001)(41300700001)(84970400001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7582 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM3PEPF00009BA0.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 74738dcf-819a-4506-c08a-08dc18f71175 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3h2Ot9oUo/gzlcxkp8LGiCzPo8wRil//7nX3i1i6K05MTQawdMMXa2LK7Q+CLq4gJs1oloe+u3XSrg6aXVObzZXO7+GAu4SoTXfAhMUeBbgLA5x7OdDrmYfCCoJmj7uoJStDIBZgcs0R4otrkxBkXwNIPkG3JnTb3v6fP5t9PmqPu7oCqhfW2g6Xw1j8rzjWkkoJyweVDwYTRQO4WVOe5Bil46rkkDWaK+ew4OKdAZVeJjFftIeRDglSkWsTa4bXDTGqoC5ezz/cjv0cGZ+gy/5G6mm61TnJZ1VmsKhJby1pNppReSF5OsKvOtl1yWHGGqwF6ikCmCVa9v2/NUEzjUFS/UqIHjSa9vmX3W3g6q8kdqJMo3BMCrLoSqnBe0AD+RWLXymkgL9IVNTJcupLnW4GhKZj65+yr/FfAUFifSVIesgNYK2M3QIXOYcbmxjePikz4qh6Q4XD6f8nsMuKe7BZNKX3UNnXlXnsj/yI2SrWsOA8Rty56Pmbg2dhPDzR2+sBX8796g03WCmfPX1rvhCCKuT8K4fSoTL+a3eElaG3utQhYNjqqz9ew8MOxyluq46xYqFqgGYqQXbuaCvQFCOGvpSgSOP6jZCgrI1zUGxdcVURdn+uFh0qkKzF4JCB7Tk6jRxHtbPFKkInd4gzSHSyt9GKmuoUELLFGykU3Za2BRuOVHd/OsWNChcqsDCTrh1OM+TpAtJisYybBllEekAe87QnIrwj9X4oc2TbUa0= 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)(4636009)(396003)(39860400002)(376002)(136003)(346002)(230922051799003)(82310400011)(64100799003)(186009)(451199024)(1800799012)(46966006)(36840700001)(6512007)(36860700001)(2906002)(36756003)(6666004)(44144004)(6506007)(33964004)(6486002)(478600001)(21480400003)(336012)(47076005)(26005)(8936002)(8676002)(4326008)(2616005)(83380400001)(235185007)(5660300002)(44832011)(70206006)(316002)(54906003)(6916009)(86362001)(70586007)(41300700001)(40480700001)(81166007)(84970400001)(82740400003)(356005)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2024 14:01:10.0028 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb493e9e-f9fa-4060-0fe0-08dc18f716f1 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: AM3PEPF00009BA0.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB7936 X-Spam-Status: No, score=-12.0 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi, The PR shows two different cases where try_promote_writeback produces an RTL pattern which isn't recognized. Currently this leads to an ICE, as we assert recog success, but I think it's better just to back out of the changes gracefully if recog fails (as we do in the main fuse_pair case). In theory since we check the ranges here recog shouldn't fail (which is why I had the assert in the first place), but the PR shows an edge case in the patterns where if we form a pre-writeback pair where the writeback offset is exactly -S, where S is the size in bytes of one transfer register, we fail to match the expected pattern as the patterns look explicitly for plus operands in the mems. I think fixing this would require adding at least four new special-case patterns to aarch64.md for what doesn't seem to be a particularly useful variant of the insns. Even if we were to do that, I think it would be GCC 15 material, and it's better to just punt for GCC 14. The ILP32 case in the PR is a bit different, as that shows us trying to combine a pair with DImode base register operands in the mems together with an SImode trailing update of the base register. This leads to us forming an RTL pattern which references the base register in both SImode and DImode, which also fails to recog. Again, I think it's best just to take the missed optimization for now. If we really want to make this (try_promote_writeback) work for ILP32, we can try to do it for GCC 15. Bootstrapped/regtested on aarch64-linux-gnu (with/without passes enabled), OK for trunk? Thanks, Alex gcc/ChangeLog: PR target/113114 * config/aarch64/aarch64-ldp-fusion.cc (try_promote_writeback): Don't assert recog success, just punt if the writeback pair isn't recognized. gcc/testsuite/ChangeLog: PR target/113114 * gcc.c-torture/compile/pr113114.c: New test. * gcc.target/aarch64/pr113114.c: New test. diff --git a/gcc/config/aarch64/aarch64-ldp-fusion.cc b/gcc/config/aarch64/aarch64-ldp-fusion.cc index 689a8c884bd..19142153f41 100644 --- a/gcc/config/aarch64/aarch64-ldp-fusion.cc +++ b/gcc/config/aarch64/aarch64-ldp-fusion.cc @@ -2672,7 +2672,15 @@ try_promote_writeback (insn_info *insn) for (unsigned i = 0; i < ARRAY_SIZE (changes); i++) gcc_assert (rtl_ssa::restrict_movement_ignoring (*changes[i], is_changing)); - gcc_assert (rtl_ssa::recog_ignoring (attempt, pair_change, is_changing)); + if (!rtl_ssa::recog_ignoring (attempt, pair_change, is_changing)) + { + if (dump_file) + fprintf (dump_file, "i%d: recog failed on wb pair, bailing out\n", + insn->uid ()); + cancel_changes (0); + return; + } + gcc_assert (crtl->ssa->verify_insn_changes (changes)); confirm_change_group (); crtl->ssa->change_insns (changes); diff --git a/gcc/testsuite/gcc.c-torture/compile/pr113114.c b/gcc/testsuite/gcc.c-torture/compile/pr113114.c new file mode 100644 index 00000000000..978e594eb3d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr113114.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-funroll-loops" } */ +float val[128]; +float x; +void bar() { + int i = 55; + for (; i >= 0; --i) + x += val[i]; +} diff --git a/gcc/testsuite/gcc.target/aarch64/pr113114.c b/gcc/testsuite/gcc.target/aarch64/pr113114.c new file mode 100644 index 00000000000..5b0383c2435 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr113114.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-mabi=ilp32 -O -mearly-ldp-fusion -mlate-ldp-fusion" } */ +void foo_n(double *a) { + int i = 1; + for (; i < (int)foo_n; i++) + a[i] = a[i - 1] + a[i + 1] * a[i]; +}