From patchwork Tue Jan 30 15:30:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Coplan X-Patchwork-Id: 1893033 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=Lw0OVT6s; 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=Lw0OVT6s; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4TPTdw4TSYz23fD for ; Wed, 31 Jan 2024 02:31:00 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 97DBE385843B for ; Tue, 30 Jan 2024 15:30:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2045.outbound.protection.outlook.com [40.107.7.45]) by sourceware.org (Postfix) with ESMTPS id 081B03858433 for ; Tue, 30 Jan 2024 15:30:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 081B03858433 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 081B03858433 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.7.45 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1706628632; cv=pass; b=CuXf8Bma9ZzJSUIFUrOH1LxkRSDZJdPvo6wSndUzWlJGf04okZmccT45xgARLAP9mUckVcUU29+ImRC5I2/fm76vE2tdmrFSkqhU6OTqP8bdYTP/CV2uCdDU/loGtkaPK5KSOuh2OsIVcKf7/1dyMa5cXRSoIyBPejR6HNq5wfg= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1706628632; c=relaxed/simple; bh=SGChkQ1TtTYRbKCs6jSxieKv+f8ACslP0qjhfOdZXmI=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=Rwrv/RCZ2cdWKHlnWGNfTDiWbQZM0vOQTYy0wLW40j6+iA/gOGM2ATSK+Z9PRUmTAz95no1j2jcwlfcGdMdpeWN7EbIWLeESyTqUSmhNGL0ogD76+fyvQi73T6YiLkHbr3OuZHBMmWZyONGYjAMAmG9cYH2pTCGLYDkQcJoZ+iw= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Ov4nwFMYLBV4NoXY8rYCOw8xrb15EH8hV8PyIAny/PtM8xIDT0rb+P9YZlbh6vqaogwehzURfSwUZ1z0Q2ydH5IKDJjkq1Re/e4koA9gtT23Y90ZqSvDtf7TzdWsc0NI1M8LoE9AqM27cbRq+xihc/2ly+WR41ff5IbUusRxufHilw9j0goayF8x9Nj2mAizbYXjXD+fkN99GR0LzZgyLD2ILX9k0zaUpfQ3y38+GazAeai/io1ptJQG2ys1iHCOKsjhCm8ODy8wAGPM1K+xNHUDYA22AdU02cVOdRFlBGmMcG3IbB4PTy+0RiUtUlucsGFpJdBN1GOF/M2+lp+wpA== 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=ujTNZA4Sk8vIVhrGV4eJOlfJYZryiZ2gC2zfPHjoS48=; b=Xiln+cmqKPAuqsV7oEdFb34D8pPfCDnQTa1UKducjVJqibfO7L1gRbLREvXSHgKfsWjaS+F21LIjnsEcjLSk+Aotxjy9euQJUA0qXu/3qO99UC6cU8FfZOrnFOGNWXcVBMqlVO0Os2T0FT1b+CHSBMhVg1FLHXbT4f+lnQ1C/qvnYtf9t6GJ2LnEv27tkklxel3x7Vy8i8YwxBUlCv6aNL9aDlL9k66jb3fiK4UOqrFxLB+x6l3XJWlPvnn1Vx56rZtT98Ghs8+4MljvBt1buAOiJEKszBN+AkmRRXL5+iRYNo45+5Qk0fQp61X8wpvZEq1asG1QMiXqwYNb41V0Qw== 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=ujTNZA4Sk8vIVhrGV4eJOlfJYZryiZ2gC2zfPHjoS48=; b=Lw0OVT6sPeCHlOlmcFgeNiUjuibMCdzktajEBoLojWnBJ0XhUuSEZJOwbWOHQ6YKgMAoQ4sPZojkq/svCVMaZmjUvOKsvH4n4T9yhnqhTc3j1xtRGNzIZkKq8C+Jue47wyCcFBTP2Pyd8W5iu/4DSNl9eP5f5hZvQpJCCC8iiAA= Received: from DUZPR01CA0187.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::17) by AM8PR08MB6418.eurprd08.prod.outlook.com (2603:10a6:20b:360::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34; Tue, 30 Jan 2024 15:30:24 +0000 Received: from DU2PEPF0001E9C6.eurprd03.prod.outlook.com (2603:10a6:10:4b6:cafe::71) by DUZPR01CA0187.outlook.office365.com (2603:10a6:10:4b6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.34 via Frontend Transport; Tue, 30 Jan 2024 15:30:24 +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 DU2PEPF0001E9C6.mail.protection.outlook.com (10.167.8.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.19 via Frontend Transport; Tue, 30 Jan 2024 15:30:24 +0000 Received: ("Tessian outbound 1076c872ecc6:v228"); Tue, 30 Jan 2024 15:30:24 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c8f1d6d0a7961e57 X-CR-MTA-TID: 64aa7808 Received: from 5dc473a92482.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9E64DC39-F191-4A58-88D2-1B2FF2B7A060.1; Tue, 30 Jan 2024 15:30:12 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5dc473a92482.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 30 Jan 2024 15:30:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XpPackEsYr8AgUFnINZrBHWwp0/ZTus219/6I/W1XEVcw3jvr5CWlQqr1U0xeKm7l4urwcmndfJeRmQPEr5UL6yZV8dpU/WrQQ90AvfvGpIJsa2Tr4EIJ3RQhmZqiq0XrPo7wb+g97n8tzkwXhd4FH3/hzR8z/v5Jx90xkmsNxsC8vYow+6jdtaIzfHTQlO2kSgbzH92LpQnElqop8Y4XSZBGQNysBhyf559KEHiwcBq6WIitNRfpK4acCnJISx4hREHgyBW4v7piJ5Q909TaUdsoJJ2xPOGEXuTsWwUy/WmoqGIdYS3dzsAEPcRjud3F3X92hRfm/91rwOUB4Jf6g== 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=ujTNZA4Sk8vIVhrGV4eJOlfJYZryiZ2gC2zfPHjoS48=; b=oYw1IAUr7FDpERtawpojQaZ4YTqu967AjvfaxEJ8jYd8lvAgkCdj6/vlgPfWqA967n5gcxYzs4uPrcSsvj7D9sDHHK07bumYStzbIZIG+f6/wwm+sVatWnlz37RQG7WTHH79yTezGMIi9ubRmTJiXMR8eyj9wm8xJBHcqNfbLplRjK2DJhm1GmfZFdGvST/1XkYIgb/OrLAnj4z8kyOm/N2jpKrPItpvJ13rVUEmAIq/pa8VSuYof3RQENLDg2/i21aeg7zQ3coleS5CC+Qx3DDzhn8MAZCUIJX4/49d7Dh8mxAotJOE9KTqP1iYZiNC8Ip3uISaGakgfqcyi7DcuQ== 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=ujTNZA4Sk8vIVhrGV4eJOlfJYZryiZ2gC2zfPHjoS48=; b=Lw0OVT6sPeCHlOlmcFgeNiUjuibMCdzktajEBoLojWnBJ0XhUuSEZJOwbWOHQ6YKgMAoQ4sPZojkq/svCVMaZmjUvOKsvH4n4T9yhnqhTc3j1xtRGNzIZkKq8C+Jue47wyCcFBTP2Pyd8W5iu/4DSNl9eP5f5hZvQpJCCC8iiAA= 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 PR3PR08MB5675.eurprd08.prod.outlook.com (2603:10a6:102:8a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.32; Tue, 30 Jan 2024 15:30:10 +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.7228.029; Tue, 30 Jan 2024 15:30:10 +0000 Date: Tue, 30 Jan 2024 15:30:08 +0000 From: Alex Coplan To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw , Richard Sandiford , Kyrylo Tkachov Subject: [PATCH] aarch64: Avoid out-of-range shrink-wrapped saves [PR111677] Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P123CA0648.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:296::19) To PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PAWPR08MB8958:EE_|PR3PR08MB5675:EE_|DU2PEPF0001E9C6:EE_|AM8PR08MB6418:EE_ X-MS-Office365-Filtering-Correlation-Id: 86f0e689-46cd-4f62-d402-08dc21a860e8 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: E3kmoZ5bBjyUsmrKPC/2YTxt4+TsODrIpyzPFVqBNFD6gLFFGFddJudfIS6Qkzxlig/AE4IkrQNqJlU7+W2ncoaaGoeZy2i51fTdETIDimyX/8Loe71q1c8nQzuBnJ4rZNStXwa3WAYyoMHuOV5sTRw9lYWwhP551wDkWwXdVVala6tlvPRQ4tt3NsjW0eHEIzqY6aaqHJ0a29q5V28skv391TtTXo1weqMDxKwgOz3aQ9y5GNMG3CS9mbD7wGyDpyvPrGlUeYno853dmMwqvM08SXRsaulo7RfVhELW6IjMXT5COYI/bs3xE0kbLqFLBv7tGhitimlVsS5jyy5ckNXtgQBAfrTiqM4U6gVjfTyV3GhXeF66W7B7+o7ONQ0wb1Dnj4YsFhxCCk5vYpDE/9ETK4SGU3zlX5oVHWLPQkL/Cv36lDGcKf/QVxFlTXNasATQZ29xiyXCFgufSw4VEzGwmcVnWyUKyO9YFhYSKNtcAG0J82+E/yKor9SisI1Hf6hcAoUZ+VpBqZxPxVs8fg9ohzk9GnvCKEHuof0nx0jT5AOxsm6/O80vzS1G9MdNwF5fNUUJl/AlgunEJWm2211A+zGBzzx+SoFE1xeXXIs= 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)(366004)(136003)(39860400002)(376002)(346002)(396003)(230922051799003)(64100799003)(1800799012)(451199024)(186009)(84970400001)(86362001)(36756003)(21480400003)(235185007)(2616005)(6512007)(38100700002)(26005)(66556008)(6486002)(41300700001)(44144004)(66476007)(6506007)(54906003)(2906002)(8676002)(478600001)(316002)(33964004)(6916009)(66946007)(44832011)(4326008)(8936002)(5660300002)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5675 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: DU2PEPF0001E9C6.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6f6a3922-bf30-4842-9060-08dc21a85887 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mrAijuscMvfKOYs8XEkZMVU0OdVGfRAkvLC3f5pw9NVmcsFQj4TzkZr+tMJhowSl5KfOItDpjkJLbP6//zLSwfRr2jFTXheG1AmaXfAUEQGyNb9AUeTXO825J6fJFRP3fRDYAVyz06XS8iFhqs+cd21w9fCr/Xp7ODnUPCRn/hvhz8R0kvPVNOu71nE8nVklkIdRsR3ox9mAIjfePLL9hlHWtRSpGoNXMa43Jk1lk7EvcRuM50HzD/XRthv5P6Jd7NvJcTp7R1oSgp8TK9f0h8WdlY/ICjMAHX3JnpQRfv0i0hqGHBmz0ta+lGXJrruSaRZjYAdSWW5v1ST65UNyMEPCt/xb7mb7lE8lM+2SPQ649AMeuGn4JGfG/AKuI2JfuM14jPqpDoc2fGtJRLqBJ7EAtTufZegB4BVsOQe3NsNicKZ7KQzzJbNUXAKQkCJlV7Xm2kaKckdGMw5jsMjYy7l1DBOhTncM8pSgsCXD0nYLcrXJGp2ulQJUgv5w1szQqTT4PtEYzIj+XNvkpQqBeEM+x1DlG0FTTL11BqR4CCf5fqlpc0UgbEow1YkIFh+0dJy90J+zDWajoFL9kw4cDSDYQqch/rRQM3loPJDYpNF7H+qZfJW809/kXmUrgu1TFfObM0oyyaKdT1CVYA6PDa6nmmxsmJ0xOqQlqfZ7R/HMvEF7UUY5Cv2OJhWKfZOrKfEFKdL4kAThNAVz68ARxgxpm5ofWDgp8hXmP9jaj+cVUSn2vITcCipdFcEFuF11 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)(136003)(376002)(346002)(39860400002)(230922051799003)(186009)(451199024)(64100799003)(82310400011)(1800799012)(36840700001)(46966006)(40470700004)(81166007)(47076005)(70586007)(70206006)(356005)(33964004)(6506007)(84970400001)(6512007)(21480400003)(44144004)(6486002)(40480700001)(40460700003)(54906003)(6916009)(316002)(8676002)(86362001)(4326008)(82740400003)(8936002)(5660300002)(336012)(2616005)(26005)(478600001)(44832011)(36860700001)(2906002)(36756003)(41300700001)(235185007)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 15:30:24.3549 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86f0e689-46cd-4f62-d402-08dc21a860e8 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: DU2PEPF0001E9C6.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6418 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 us ICEing due to an unrecognizable TFmode save emitted by aarch64_process_components. The problem is that for T{I,F,D}mode we conservatively require mems to be in range for x-register ldp/stp. That is because (at least for TImode) it can be allocated to both GPRs and FPRs, and in the GPR case that is an x-reg ldp/stp, and the FPR case is a q-register load/store. As Richard pointed out in the PR, aarch64_get_separate_components already checks that the offsets are suitable for a single load, so we just need to choose a mode in aarch64_reg_save_mode that gives the full q-register range. In this patch, we choose V16QImode as an alternative 16-byte "bag-of-bits" mode that doesn't have the artificial range restrictions imposed on T{I,F,D}mode. For T{F,D}mode in GCC 15 I think we could consider relaxing the restriction imposed in aarch64_classify_address, as AFAIK T{F,D}mode can only be allocated to FPRs (unlike TImode). But such a change seems too invasive to consider for GCC 14 at this stage (let alone backports). Fortunately the new flexible load/store pair patterns in GCC 14 allow this mode change to work without further changes. The backports are more involved as we need to adjust the load/store pair handling to cater for V16QImode in a few places. Note that for the testcase we are relying on the torture options to add -funroll-loops at -O3 which is necessary to trigger the ICE on trunk (but not on the 13 branch). Bootstrapped/regtested on aarch64-linux-gnu, OK for trunk? Thanks, Alex gcc/ChangeLog: PR target/111677 * config/aarch64/aarch64.cc (aarch64_reg_save_mode): Use V16QImode for the full 16-byte FPR saves in the vector PCS case. gcc/testsuite/ChangeLog: PR target/111677 * gcc.target/aarch64/torture/pr111677.c: New test. diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index a37d47b243e..4556b8dd504 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -2361,7 +2361,7 @@ aarch64_reg_save_mode (unsigned int regno) case ARM_PCS_SIMD: /* The vector PCS saves the low 128 bits (which is the full register on non-SVE targets). */ - return TFmode; + return V16QImode; case ARM_PCS_SVE: /* Use vectors of DImode for registers that need frame diff --git a/gcc/testsuite/gcc.target/aarch64/torture/pr111677.c b/gcc/testsuite/gcc.target/aarch64/torture/pr111677.c new file mode 100644 index 00000000000..6bb640c42c0 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/torture/pr111677.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fopenmp } */ +/* { dg-options "-ffast-math -fstack-protector-strong -fopenmp" } */ +typedef struct { + long size_z; + int width; +} dt_bilateral_t; +typedef float dt_aligned_pixel_t[4]; +#pragma omp declare simd +void dt_bilateral_splat(dt_bilateral_t *b) { + float *buf; + long offsets[8]; + for (; b;) { + int firstrow; + for (int j = firstrow; j; j++) + for (int i; i < b->width; i++) { + dt_aligned_pixel_t contrib; + for (int k = 0; k < 4; k++) + buf[offsets[k]] += contrib[k]; + } + float *dest; + for (int j = (long)b; j; j++) { + float *src = (float *)b->size_z; + for (int i = 0; i < (long)b; i++) + dest[i] += src[i]; + } + } +}