From: "H.J. Lu" <hjl.tools@gmail.com>
To: Jeff Law <law@redhat.com>, Jakub Jelinek <jakub@redhat.com>,
Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
Vladimir Makarov <vmakarov@redhat.com>,
Richard Sandiford <richard.sandiford@arm.com>
Subject: PING^3 [GCC 10] [PATCH] IRA: Don't make a global register eliminable
Date: Tue, 29 Sep 2020 05:38:34 -0700 [thread overview]
Message-ID: <CAMe9rOrg1i-=LOXNV8D0Bsoep9cPS6JS-7Dpj7wnFdrKTnTtcw@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOogSe07jHSrAyFVAf0-kyR6QGVamsDD797V51zxCu=P5Q@mail.gmail.com>
On Fri, Sep 25, 2020 at 6:46 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Tue, Sep 22, 2020 at 10:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Fri, Sep 18, 2020 at 10:21 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Thu, Sep 17, 2020 at 3:52 PM Jeff Law <law@redhat.com> wrote:
> > > >
> > > >
> > > > On 9/16/20 8:46 AM, Richard Sandiford wrote:
> > > >
> > > > "H.J. Lu" <hjl.tools@gmail.com> writes:
> > > >
> > > > On Tue, Sep 15, 2020 at 7:44 AM Richard Sandiford
> > > > <richard.sandiford@arm.com> wrote:
> > > >
> > > > Thanks for looking at this.
> > > >
> > > > "H.J. Lu" <hjl.tools@gmail.com> writes:
> > > >
> > > > commit 1bcb4c4faa4bd6b1c917c75b100d618faf9e628c
> > > > Author: Richard Sandiford <richard.sandiford@arm.com>
> > > > Date: Wed Oct 2 07:37:10 2019 +0000
> > > >
> > > > [LRA] Don't make eliminable registers live (PR91957)
> > > >
> > > > didn't make eliminable registers live which breaks
> > > >
> > > > register void *cur_pro asm("reg");
> > > >
> > > > where "reg" is an eliminable register. Make fixed eliminable registers
> > > > live to fix it.
> > > >
> > > > I don't think fixedness itself is the issue here: it's usual for at
> > > > least some registers involved in eliminations to be fixed registers.
> > > >
> > > > I think what makes this case different is instead that cur_pro/ebp
> > > > is a global register. But IMO things have already gone wrong if we
> > > > think that a global register is eliminable.
> > > >
> > > > So I wonder if instead we should check global_regs at the beginning of:
> > > >
> > > > for (i = 0; i < fp_reg_count; i++)
> > > > if (!TEST_HARD_REG_BIT (crtl->asm_clobbers,
> > > > HARD_FRAME_POINTER_REGNUM + i))
> > > > {
> > > > SET_HARD_REG_BIT (eliminable_regset,
> > > > HARD_FRAME_POINTER_REGNUM + i);
> > > > if (frame_pointer_needed)
> > > > SET_HARD_REG_BIT (ira_no_alloc_regs,
> > > > HARD_FRAME_POINTER_REGNUM + i);
> > > > }
> > > > else if (frame_pointer_needed)
> > > > error ("%s cannot be used in %<asm%> here",
> > > > reg_names[HARD_FRAME_POINTER_REGNUM + i]);
> > > > else
> > > > df_set_regs_ever_live (HARD_FRAME_POINTER_REGNUM + i, true);
> > > >
> > > > (ira_setup_eliminable_regset), and handle the global_regs[] case in
> > > > the same way as the else case, i.e. short-circuiting both of the ifs.
> > > >
> > > > Like this?
> > > >
> > > > Sorry for the delay. I was testing this in parallel.
> > > >
> > > > Bootstrapped & regression-tested on x86_64-linux-gnu.
> > > >
> > > > Thanks,
> > > > Richard
> > > >
> > > >
> > > > 0001-ira-Fix-elimination-for-global-hard-FPs-PR91957.patch
> > > >
> > > > From af4499845d26fe65573b21197a79fd22fd38694e Mon Sep 17 00:00:00 2001
> > > > From: "H.J. Lu" <hjl.tools@gmail.com>
> > > > Date: Tue, 15 Sep 2020 06:23:26 -0700
> > > > Subject: [PATCH] ira: Fix elimination for global hard FPs [PR91957]
> > > > MIME-Version: 1.0
> > > > Content-Type: text/plain; charset=UTF-8
> > > > Content-Transfer-Encoding: 8bit
> > > >
> > > > If the hard frame pointer is being used as a global register,
> > > > we should skip the usual handling for eliminations. As the
> > > > comment says, the register cannot in that case be eliminated
> > > > (or eliminated to) and is already marked live where appropriate.
> > > >
> > > > Doing this removes the duplicate error for gcc.target/i386/pr82673.c.
> > > > The “cannot be used in 'asm' here” message is meant to be for asm
> > > > statements rather than register asms, and the function that the
> > > > error is reported against doesn't use asm.
> > > >
> > > > gcc/
> > > > 2020-09-16 Richard Sandiford <richard.sandiford@arm.com>
> > > >
> > > > PR middle-end/91957
> > > > * ira.c (ira_setup_eliminable_regset): Skip the special elimination
> > > > handling of the hard frame pointer if the hard frame pointer is fixed.
> > > >
> > > > gcc/testsuite/
> > > > 2020-09-16 H.J. Lu <hjl.tools@gmail.com>
> > > > Richard Sandiford <richard.sandiford@arm.com>
> > > >
> > > > PR middle-end/91957
> > > > * g++.target/i386/pr97054.C: New test.
> > > > * gcc.target/i386/pr82673.c: Remove redundant extra message.
> > > >
> > > > OK
> > >
> > > OK for GCC 10 branch?
> > >
> > > Thanks.
> >
> > PING:
> >
> > https://gcc.gnu.org/pipermail/gcc-patches/2020-September/554268.html
> >
>
> PING.
>
PING.
--
H.J.
next prev parent reply other threads:[~2020-09-29 12:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 13:23 [PATCH] LRA: Make fixed eliminable registers live H.J. Lu
2020-09-15 14:44 ` Richard Sandiford
2020-09-15 14:56 ` H.J. Lu
2020-09-16 13:37 ` [PATCH] IRA: Don't make a global register eliminable H.J. Lu
2020-09-16 14:46 ` Richard Sandiford
2020-09-16 15:11 ` H.J. Lu
2020-09-17 22:52 ` Jeff Law
2020-09-18 17:21 ` [GCC 10] " H.J. Lu
2020-09-22 17:48 ` PING " H.J. Lu
2020-09-25 13:46 ` PING^2 " H.J. Lu
2020-09-29 12:38 ` H.J. Lu [this message]
2020-09-29 13:53 ` PING^3 " Vladimir Makarov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMe9rOrg1i-=LOXNV8D0Bsoep9cPS6JS-7Dpj7wnFdrKTnTtcw@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=law@redhat.com \
--cc=richard.guenther@gmail.com \
--cc=richard.sandiford@arm.com \
--cc=vmakarov@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).