public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@redhat.com>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] [LRA] Fix wrong-code PR 91109 take 2
Date: Fri, 16 Aug 2019 15:36:00 -0000	[thread overview]
Message-ID: <4b5ab04e-74fe-9858-c434-f1d78384aa4c@redhat.com> (raw)
In-Reply-To: <6ef8ef98-f7aa-3809-ba2d-4be618c12138@redhat.com>


On 2019-08-16 11:06 a.m., Vladimir Makarov wrote:
>
> On 2019-08-15 3:46 p.m., Bernd Edlinger wrote:
>> Hi,
>>
>> as discussed in the PR 91109 audit trail,
>> my previous patch missed a case where no spilling is necessary,
>> but the re-materialized instruction has now scratch regs without
>> a hard register assignment.  And thus the LRA pass falls out of
>> the loop pre-maturely.
>>
>> Fixed by checking for scratch regs with no assignment
>> and continuing the loop in that case.
>>
>>
>> Boot-strapped and reg-tested on x86_64-pc-linux-gnu and 
>> arm-linux-gnueabihf.
>> Is it OK for trunk?
>
> Sorry, I am afraid this patch can make LRA cycle forever in some cases.
>
> The reason for this is an existing pattern (scratch "r,X").  So if LRA 
> makes a choice for the 2nd alternative, it will be a former spilled 
> scratch (such spilled pseudo is changed into scratch at the end of 
> LRA).  In this case the constraint subpass satisfies all constraints. 
> There are no changes at all but because there are spilled (not in 
> remat subpass) former scratches we continue the loop.
>
> I guess you need something more accurate interaction with remat subpass.
>
>
Sorry, I missed that your new code is run only if remat returns true 
which means some changes in it.  It was not seen in the patch context.  
So there will be no cycling as remat at some point stop to do changes.

The patch is ok for trunk and gcc-9 branch.

Thank you, Bernd


      reply	other threads:[~2019-08-16 15:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05 21:09 [PATCH] [LRA] Fix wrong-code PR 91109 Bernd Edlinger
2019-08-07 13:51 ` Vladimir Makarov
2019-08-09 10:59   ` Bernd Edlinger
2019-08-09 11:01     ` Jakub Jelinek
2019-08-15 19:47   ` [PATCH] [LRA] Fix wrong-code PR 91109 take 2 Bernd Edlinger
2019-08-16 12:07     ` Bernd Edlinger
2019-08-16 15:19     ` Vladimir Makarov
2019-08-16 15:36       ` Vladimir Makarov [this message]

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=4b5ab04e-74fe-9858-c434-f1d78384aa4c@redhat.com \
    --to=vmakarov@redhat.com \
    --cc=bernd.edlinger@hotmail.de \
    --cc=gcc-patches@gcc.gnu.org \
    /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).