From patchwork Thu Apr 22 06:37:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 1468993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FQnlc10Gbz9sWD for ; Thu, 22 Apr 2021 16:37:14 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F04BC3894416; Thu, 22 Apr 2021 06:37:10 +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-oln040092066031.outbound.protection.outlook.com [40.92.66.31]) by sourceware.org (Postfix) with ESMTPS id 62B1A3835409 for ; Thu, 22 Apr 2021 06:37:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 62B1A3835409 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bernd.edlinger@hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CbeU4jWyvD0peQ/KPLlXS9MMbBLZltWr2L/+XeUa/LH+sylVimAU1e5WShN6aFxyb5c/qyY5WUdm/1KBpDQw3mloe7huk9kV6wYY016Es5rgjUX6kUO063xozc8cOZrzHgIpEaCweYaV0WrLg6gmfYd8TaL/7lZAT9/O/B1noFbilTiQvtSw+T0bFxpjuEEiOZz8ImIJXtMw6nn8+FvG3JOtKUqeksz/5OYa10E1DsoHAhKjYT2re1CVrIAWLGk/NqFxOgEflth8MDwJf1Geerlx3VTbhwVZPnEvTpLx2eMmQcENAXdojbrFOq3J32F/DeYMMBL0eHHNKY280xDznw== 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=XevkQxoaCmOOo7UC5x79waEQGxxy0rKMIZaY6x0p4Qg=; b=NnD6rqgmXK3GS13tcP3Zo1mloRR5tWBHWhY52wXmbVEmNpMSfCgqhL8e+5aaQ99pVeFHcsumsJN9WBmi+9PpqB1mfCkKJ2Rjpml/sag90+Bv2rMqE9zjW+wTlcKn1VpOnGlmlUPxnVbBfvwFlmyvDporxb46CIvh5Uvlroy+Du/aTfLKZ9ZF8OO8v7VyDXNuMQZj7KDM1vYTvuhWUbXVwQrl6B+r2rUyzwd8r/UjUPsRWrlxnxpoIOs2Sap9gokwvCyDf9H00Z13KDT+iV4ltucKxJVCOlFNjfqssCbqIT0Fyel9V/TYhA0ICllXNWEuMSk9/HM1Py3NPk6yvn5BLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from HE1EUR01FT014.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::49) by HE1EUR01HT208.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::395) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Thu, 22 Apr 2021 06:37:05 +0000 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:7e18::4a) by HE1EUR01FT014.mail.protection.outlook.com (2a01:111:e400:7e18::156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21 via Frontend Transport; Thu, 22 Apr 2021 06:37:05 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:88EB224BDE797A6AC0B57941687C82AACDEF9D7704A87EEE33023C74727FC218; UpperCasedChecksum:106C256606F6B0C51634E27BD5A1BF6629D99EE20326FA07D3BB4E56A5F9BF5E; SizeAsReceived:7683; Count:46 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::dcf:d4ce:7dcb:ca5a]) by AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::dcf:d4ce:7dcb:ca5a%2]) with mapi id 15.20.4065.022; Thu, 22 Apr 2021 06:37:05 +0000 To: "gcc-patches@gcc.gnu.org" From: Bernd Edlinger Subject: [PATCH] Fix target/100106 ICE in gen_movdi Message-ID: Date: Thu, 22 Apr 2021 08:37:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Content-Language: en-US X-TMN: [HC9PGITmSIJd9QYgPJbUb6e79U9ebSoB] X-ClientProxiedBy: FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) To AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:364::23) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (92.211.180.34) by FR3P281CA0032.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.17 via Frontend Transport; Thu, 22 Apr 2021 06:37:04 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 1b3bd4c8-f3b1-4c71-0464-08d905590b62 X-MS-TrafficTypeDiagnostic: HE1EUR01HT208: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /0m9qY/8Uv+8O6Jk7vxgDd/gXnGLu0zmgSD7HRD1J7VLXh97tsN9gdVK5JgqdqYuUIa8RIIvs82q1SRybu6GZE+lCxa+eqz/R0GH3Du3m84Jn5oAABKLnunYa02WWhIHUNxlLmkJx5qkbHNw1r2XSyzvdipiMSMrsN8jUGdcF1dW0ykQJtv/+r5HaBXgcwr7SmfX5QAnzlwkUnOtgrhIxmizx5WtXcMqPwkcDmM7i8UpdSrBzNowhzYSJvTSZ7H2899Q0iJWQo20KtxZzJIBlef3Q+gNM8ADVa6WP8bLUZ7ZO7EZVBWt7XqlSA36q3Q2DdUpyIvLGtto6RC7R7r9l4dOMIjkdXF8QlOew2z2+NOYx3qzIRDnKu0wIryuB+Qe0Jc0n5HojehuNjfdmy539A== X-MS-Exchange-AntiSpam-MessageData: Lkw+x6ir1v3puPm+d4pC/eR4Ny7M4xIjTdVCcCsYkdGRMVIKq4kwvA1A6u0CFuuFBv1jo795Qd1FW5oOXzHnfU/iPW2+HJOPnT9yGkfD1ouYnVwLEQKGyMDvbfgTcw9LP22N6o3IzjcA76k+cYdoZw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b3bd4c8-f3b1-4c71-0464-08d905590b62 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2021 06:37:05.6850 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT014.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR01HT208 X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham 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: , Cc: Richard Biener Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" As the test case shows, the outer mode may have a higher alignment requirement than the inner mode here. 2021-04-22 Bernd Edlinger PR target/100106 * gimplify-rtx.c (simplify_context::simplify_subreg): Check the memory alignment for the outer mode. * gcc.c-torture/compile/pr100106.c: New testcase. --- gcc/simplify-rtx.c | 1 + gcc/testsuite/gcc.c-torture/compile/pr100106.c | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr100106.c diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index d13c390..ad3b7b2 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -7217,6 +7217,7 @@ simplify_context::simplify_subreg (machine_mode outermode, rtx op, have instruction to move the whole thing. */ && (! MEM_VOLATILE_P (op) || ! have_insn_for (SET, innermode)) + && !(STRICT_ALIGNMENT && MEM_ALIGN (op) < GET_MODE_ALIGNMENT (outermode)) && known_le (outersize, innersize)) return adjust_address_nv (op, outermode, byte); diff --git a/gcc/testsuite/gcc.c-torture/compile/pr100106.c b/gcc/testsuite/gcc.c-torture/compile/pr100106.c new file mode 100644 index 0000000..7f98b4f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr100106.c @@ -0,0 +1,11 @@ +union a { + float _Complex b; + long long c; +}; + +void g(union a); + +void e() { + union a f = {1.0f}; + g(f); +}