From patchwork Tue Jan 21 17:20:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel X-Patchwork-Id: 182908 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4100252ile; Tue, 21 Jan 2020 09:21:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzG2RV6Rnk6ut2oXw0qbb6oJgkzbtdQGzoOOYANK4cq7twz6bSw8JWOfTA7AL5ypUrmM9bJ X-Received: by 2002:aca:d4c1:: with SMTP id l184mr3846014oig.172.1579627291851; Tue, 21 Jan 2020 09:21:31 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id f23si21706767oto.205.2020.01.21.09.21.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jan 2020 09:21:31 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-517921-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=aym6SU8I; dkim=neutral (body hash did not verify) header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ew+TZB40; dkim=neutral (body hash did not verify) header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ew+TZB40; arc=fail (body hash mismatch); spf=pass (google.com: domain of gcc-patches-return-517921-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-517921-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type:mime-version; q=dns; s=default; b=YPUq3yDuwR03idU316UD/csi22xsHjjJPelS9UPDna79m+RDb0 LjSl6PMRFxYYPKkgQtgEI5PAuk6eyqkrmgRVtfn0EuluUYE4o/DB6m/8J66XlAOB hW4n3GjUd322Sz0Z2JUfgv9jFvAz6pPElitC8lowCtbH/XPJ1eg/qMYBQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type:mime-version; s= default; bh=Xyn3yTJZ0HHf39+ZW3wSIIF9RGY=; b=aym6SU8ID34UU3bho8Gb km0/1Og7cAsxW/Eh/NanAWbQRJv/j0POdtA3SzFVwGv47Um5FhApn2ldm+DDcBZH cNdJBUs2xLYqc9CNo07uosdiXyd2rQtNTbFtKHsBDF3ifXJpoZ7GyuhTpSYhrBmJ w8aK/OjnS2UqWWL6cFTXz/4= Received: (qmail 38862 invoked by alias); 21 Jan 2020 17:21:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 38749 invoked by uid 89); 21 Jan 2020 17:21:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LOTSOFHASH, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 spammy=regional X-HELO: EUR02-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr20069.outbound.protection.outlook.com (HELO EUR02-VE1-obe.outbound.protection.outlook.com) (40.107.2.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2020 17:21:01 +0000 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=KXvbzyJfN+r1sBowxPMQuZOhl3sJORagBzOq1zpaQzc=; b=ew+TZB40mJVstzXVWyqf/rUHyaT4HoBnbkJEqwmR3gDCVyHcGv8LIHyOhh6v4YMs90l+epOiuBcno6wWEY0GvXd2e3falbK7Vr62PKgACLl392+fbsLEofe33s0mhVGe3EjnF7YlJ1R7sa0Ra0I4YoxNkwOtbXoDL7RX52KSLqg= Received: from VE1PR08CA0016.eurprd08.prod.outlook.com (2603:10a6:803:104::29) by AM6PR08MB3783.eurprd08.prod.outlook.com (2603:10a6:20b:8a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Tue, 21 Jan 2020 17:20:58 +0000 Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::207) by VE1PR08CA0016.outlook.office365.com (2603:10a6:803:104::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19 via Frontend Transport; Tue, 21 Jan 2020 17:20:58 +0000 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=bestguesspass 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 DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23 via Frontend Transport; Tue, 21 Jan 2020 17:20:58 +0000 Received: ("Tessian outbound 1da651c29646:v40"); Tue, 21 Jan 2020 17:20:58 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 502510503cdd2239 X-CR-MTA-TID: 64aa7808 Received: from 0f6f50aa0fc4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 497B3238-5BFF-4844-BEB7-92986C919192.1; Tue, 21 Jan 2020 17:20:53 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0f6f50aa0fc4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 21 Jan 2020 17:20:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MYbMnYJyZ4jFmVVoCevJ+xfGdwhtRwMERfezyJvn8XtgR+6WrHgTe7CcpwTso+FZ6CQht/1w2lmiZq1G+xbIR2VT3PgNCWWWIab7KjsrGLy/cBdplHo3XWmJ7j4i2iY3m5w0hNVzmN4c4DrGZ0u70xroUm8unBSOJShBo6XAURZj6K0Usee9S+dwSneilqoAAMAaGhssVWneuTTGxX1q2yulybI6/X3b0ZpuMT6ix2+37myBg4P3pG6+PZL0yKIV4Y1EyrgJwJdpI7c9BT76fdGrKGEfS8dprBNmMMqctYStHeqvowaO8Q32lDR1+y85EDL+fFEDNDID7/pOIhrOEw== 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=KXvbzyJfN+r1sBowxPMQuZOhl3sJORagBzOq1zpaQzc=; b=JHfGeE0PvmmZNb8RPPYCVDpkTMaJxyeWxxSCbsrsYilGayYU0IOBCdjYUGN2zOOBww4pGk+Gqe8UG6OVY5mvsTwCE+Bchcju4fk8F2qAdHEzTyZHsTOdDbYjm84G9pI2hLzrL1k85LWsnR6mH2/OJqvndg6szwGSF2VtWtjP9yQI795RoEOQ0FJej29V7NSQIXlwssHQ/Ra/CRncpeT1oTXncui0TinCYdiG08yAuu0taj25tx20Kic2Idzq/2vW/0rUT1Su0cCo+p5pfwmCalSancy9M7gDtagr9aTHYaW3zlIHjsNGsSdY+Wezlm1NH0GczjLJkmscdDhESVNtMw== 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=KXvbzyJfN+r1sBowxPMQuZOhl3sJORagBzOq1zpaQzc=; b=ew+TZB40mJVstzXVWyqf/rUHyaT4HoBnbkJEqwmR3gDCVyHcGv8LIHyOhh6v4YMs90l+epOiuBcno6wWEY0GvXd2e3falbK7Vr62PKgACLl392+fbsLEofe33s0mhVGe3EjnF7YlJ1R7sa0Ra0I4YoxNkwOtbXoDL7RX52KSLqg= Received: from DB6PR0801MB1992.eurprd08.prod.outlook.com (10.168.86.9) by DB6PR0801MB1896.eurprd08.prod.outlook.com (10.168.85.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Tue, 21 Jan 2020 17:20:51 +0000 Received: from DB6PR0801MB1992.eurprd08.prod.outlook.com ([fe80::318e:788b:74db:a0df]) by DB6PR0801MB1992.eurprd08.prod.outlook.com ([fe80::318e:788b:74db:a0df%7]) with mapi id 15.20.2644.026; Tue, 21 Jan 2020 17:20:51 +0000 From: Joel Hutton To: "gcc-patches@gcc.gnu.org" CC: "vmakarov@redhat.com" , nd , "ebotcazou@adacore.com" Subject: [GCC][IRA] Revert 11b8091fb to fix Bug 93221 Date: Tue, 21 Jan 2020 17:20:51 +0000 Message-ID: <586c7e2d-5305-7bd2-8d57-85693feffb16@arm.com> user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Joel.Hutton@arm.com; x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(136003)(396003)(366004)(39860400002)(189003)(199004)(6916009)(2906002)(4744005)(6512007)(6486002)(71200400001)(6506007)(8936002)(26005)(31686004)(81166006)(5660300002)(186003)(66476007)(2616005)(66446008)(31696002)(966005)(316002)(76116006)(66556008)(54906003)(86362001)(66946007)(81156014)(64756008)(66616009)(36756003)(4326008)(478600001)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0801MB1896; H:DB6PR0801MB1992.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: +uy3Pr/qZe6POXLPLa9fri2sCEvjkIjBQAQzs5oOpauq+nv/bnoB6Zol30Wo1I24tWgwCC2AmfhAtU9y6RfgqTespMGGhrcH/00OgNZ0tOc2Z3/eUms1u/hhIM4b1NI2GlWr9VDzuqjMyWZzSOLD5edykLvISb0T351VZhbpEGOORZOR2D8rOxRKnDmVCdyYeHi5TJl//O/2bNClrbgNgBr5qoFyZ5cXpeJxh+u2zocLae09DAqorM3RwWBmaUh3vRKhHtgR4mxN3QMUFM75JA4e0poHOd3uc7ucJByXZ3Afl5U15bcC1I/o5xccLQkg6VbK6X7UL0DB7Jcx6UWcZDqofXdulDg2ACEHSx9XJFIk/0+Xjo8rqOzmA+S7KueQkl6eRL+59nAMn44fAcc2OWh812gPZKJziQVEGtQi6fhbWdnvoySVh2cYS8B9XWiZbC4FCRTx5whAa74trsBilVKvDnRKQ3JHZ5XmFp0iHUM/Hc0oqomvVT98yul7eb8mbfCtu01b3i3EHAajyktxGA== x-ms-exchange-transport-forked: True MIME-Version: 1.0 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Joel.Hutton@arm.com; Return-Path: Joel.Hutton@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 6360b644-c726-4cf7-6a89-08d79e9643cb X-IsSubscribed: yes Hi all, A previous change to simplify LRA introduced in 11b809 (From-SVN: r279550) disabled hard register splitting for -O0. This causes a problem on aarch64 in cases where parameters are passed in multiple registers (in the bug report an OI passed in 2 V4SI registers). This is mandated by the AAPCS. Vlad, Eric, do you have a preferred alternate solution to reverting the patch? Previously discussed here: https://gcc.gnu.org/ml/gcc-patches/2019-12/msg01414.html Bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93221 Bootstrapped and regression tested on aarch64 Changelog: 2020-01-21  Joel Hutton          * ira.c (ira): Revert use of simplified LRA algorithm. gcc/testsuite/ChangeLog: 2020-01-21  Joel Hutton          PR bug/93221         * gcc.target/aarch64/pr93221.c: New test. >From 0d9980d2327c61eb99d041a217d6ea5c5b34c754 Mon Sep 17 00:00:00 2001 From: Joel Hutton Date: Tue, 21 Jan 2020 09:37:48 +0000 Subject: [PATCH] [IRA] Fix bug 93221 by reverting 11b8091fb 11b8091fb introduced a simplified LRA algorithm for -O0 that turned off hard register splitting, this causes a problem for parameters passed in multiple registers on aarch64. This fixes bug 93221. --- gcc/ira.c | 38 +++++++++------------- gcc/testsuite/gcc.target/aarch64/pr93221.c | 10 ++++++ 2 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/pr93221.c diff --git a/gcc/ira.c b/gcc/ira.c index 46091adf8109263c72343dccfe4913857b5c74ae..c8b5f869da121506f0414901271eae9810689316 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -5205,35 +5205,27 @@ ira (FILE *f) /* Perform target specific PIC register initialization. */ targetm.init_pic_reg (); - if (optimize) - { - ira_conflicts_p = true; - - /* Determine the number of pseudos actually requiring coloring. */ - unsigned int num_used_regs = 0; - for (unsigned int i = FIRST_PSEUDO_REGISTER; i < DF_REG_SIZE (df); i++) - if (DF_REG_DEF_COUNT (i) || DF_REG_USE_COUNT (i)) - num_used_regs++; - - /* If there are too many pseudos and/or basic blocks (e.g. 10K - pseudos and 10K blocks or 100K pseudos and 1K blocks), we will - use simplified and faster algorithms in LRA. */ - lra_simple_p - = ira_use_lra_p - && num_used_regs >= (1U << 26) / last_basic_block_for_fn (cfun); - } - else - { - ira_conflicts_p = false; - lra_simple_p = ira_use_lra_p; - } + ira_conflicts_p = optimize > 0; + + /* Determine the number of pseudos actually requiring coloring. */ + unsigned int num_used_regs = 0; + for (unsigned int i = FIRST_PSEUDO_REGISTER; i < DF_REG_SIZE (df); i++) + if (DF_REG_DEF_COUNT (i) || DF_REG_USE_COUNT (i)) + num_used_regs++; + + /* If there are too many pseudos and/or basic blocks (e.g. 10K + pseudos and 10K blocks or 100K pseudos and 1K blocks), we will + use simplified and faster algorithms in LRA. */ + lra_simple_p + = ira_use_lra_p + && num_used_regs >= (1U << 26) / last_basic_block_for_fn (cfun); if (lra_simple_p) { /* It permits to skip live range splitting in LRA. */ flag_caller_saves = false; /* There is no sense to do regional allocation when we use - simplified LRA. */ + simplified LRA. */ flag_ira_region = IRA_REGION_ONE; ira_conflicts_p = false; } diff --git a/gcc/testsuite/gcc.target/aarch64/pr93221.c b/gcc/testsuite/gcc.target/aarch64/pr93221.c new file mode 100644 index 0000000000000000000000000000000000000000..517135a889de8a7e379c79222f8a8b2efcc7b422 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr93221.c @@ -0,0 +1,10 @@ +/* PR bug/93221 */ +/* { dg-do compile } */ +/* { dg-options "-O0 -mno-omit-leaf-frame-pointer" } */ + +struct S { __Int32x4_t b[2]; }; + +void __attribute__((optimize (0))) +foo (struct S x) +{ +} -- 2.17.1