This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[GCC][IRA] Revert 11b8091fb to fix Bug 93221
- From: Joel Hutton <Joel dot Hutton at arm dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: "vmakarov at redhat dot com" <vmakarov at redhat dot com>, nd <nd at arm dot com>, "ebotcazou at adacore dot com" <ebotcazou at adacore dot com>
- Date: Tue, 21 Jan 2020 17:20:51 +0000
- Subject: [GCC][IRA] Revert 11b8091fb to fix Bug 93221
- 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
- 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-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==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Joel dot Hutton at arm dot com;
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 <Joel.Hutton@arm.com\>
* ira.c (ira): Revert use of simplified LRA algorithm.
gcc/testsuite/ChangeLog:
2020-01-21 Joel Hutton <Joel.Hutton@arm.com\>
PR bug/93221
* gcc.target/aarch64/pr93221.c: New test.
From 0d9980d2327c61eb99d041a217d6ea5c5b34c754 Mon Sep 17 00:00:00 2001
From: Joel Hutton <Joel.Hutton@arm.com>
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