public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Renlin Li <renlin.li@foss.arm.com>
Cc: Christophe Lyon <christophe.lyon@linaro.org>,
	       gcc Patches <gcc-patches@gcc.gnu.org>,
	bergner@linux.ibm.com
Subject: Re: [PATCH] combine: Do not combine moves from hard registers
Date: Fri, 02 Nov 2018 23:03:00 -0000	[thread overview]
Message-ID: <20181102230320.GV5994@gate.crashing.org> (raw)
In-Reply-To: <a27db9c8-97c9-9b62-7d62-769c49220229@foss.arm.com>

Hi!

On Fri, Nov 02, 2018 at 10:19:01PM +0000, Renlin Li wrote:
> I find a problem with your change to add make_more_copies.
> I am investigating those regressions, a big amount of them are wrong code 
> generation.
> 
> One problem is that, make_more_copies will split the assignment of fp to 
> sfp.
> 
> From:
> (insn 48 26 28 5 (set (reg/f:SI 102 sfp)
>         (reg/f:SI 11 fp)) -1
> To:
> (insn 51 32 26 5 (set (reg:SI 117)
>         (reg/f:SI 11 fp)) 646 {*arm_movsi_vfp}
>      (expr_list:REG_EQUIV (reg/f:SI 11 fp)
>         (nil)))
> (insn 48 26 28 5 (set (reg/f:SI 102 sfp)
>         (reg:SI 117)) 646 {*arm_movsi_vfp}
>      (expr_list:REG_DEAD (reg:SI 117)
>         (nil)))

I was looking at this just now :-)  (PR87871)

fp is a hard reg, but not a fixed reg, so make_more_moves thinks it is
fine to copy it to some pseudo, before copying it to the final dest.  And
that is just fine as far as I can see.

That final dest is sfp, and that final move is moved over the clobber of
fp, and yes eventually deleted as you say below.

> The original rtx is generated by expand_builtin_setjmp_receiver to adjust 
> the frame pointer.
> 
> And later in LRA, it will try to eliminate frame_pointer with hard frame 
> pointer which is
> defined the ELIMINABLE_REGS.
> 
> Your change split the insn into two.
> This makes it doesn't match the "from" and "to" regs defined in 
> ELIMINABLE_REGS.
> The if statement to generate the adjustment insn is been skipt.
> And the original instruction is just been deleted!

I don't follow why, or what should have prevented it from being deleted.

> Probably, we don't want to split the move rtx if they are related to 
> entries defined in ELIMINABLE_REGS?

One thing I can easily do is not making an intermediate pseudo when copying
*to* a fixed reg, which sfp is.  Let me try if that helps the testcase I'm
looking at (setjmp-4.c).


Segher

  reply	other threads:[~2018-11-02 23:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 21:06 Segher Boessenkool
2018-10-22 22:07 ` Jeff Law
2018-10-22 22:46   ` Segher Boessenkool
2018-10-23 10:54 ` Christophe Lyon
2018-10-23 12:36   ` Christophe Lyon
2018-10-23 13:10     ` Segher Boessenkool
2018-10-23 13:30       ` Christophe Lyon
2018-10-23 13:08   ` Segher Boessenkool
2018-10-23 13:50     ` Christophe Lyon
2018-10-24  1:50       ` Segher Boessenkool
2018-10-24  9:52         ` Christophe Lyon
2018-11-02 22:19           ` Renlin Li
2018-11-02 23:03             ` Segher Boessenkool [this message]
2018-11-02 23:54               ` Segher Boessenkool
2018-11-03  2:34                 ` Jeff Law
2018-11-05 12:35                   ` Renlin Li
2018-11-05 18:16                     ` Renlin Li
2018-11-07 23:02                       ` Segher Boessenkool
2018-11-09 10:21                         ` Richard Earnshaw (lists)
2018-11-05 22:50                     ` Segher Boessenkool
2018-10-24  9:38   ` Paul Hua
2018-10-23 16:16 ` Andreas Schwab
2018-10-23 16:28   ` Segher Boessenkool
2018-10-24 12:24     ` Andreas Schwab
2018-10-26 17:41       ` Steve Ellcey
2018-10-26 18:37         ` Segher Boessenkool
     [not found]           ` <7bc8697f-a09e-627f-b032-eba5ecb682ac@arm.com>
2018-11-08 20:34             ` Segher Boessenkool
2018-11-09 21:12               ` Jeff Law
2018-11-10  4:51                 ` Segher Boessenkool
2018-11-10 16:54                   ` Jeff Law
2018-11-12 11:57               ` Sam Tebbs
     [not found]               ` <e9104024-2f6a-6cb8-e366-39b96f7a72f2@arm.com>
2018-11-12 12:54                 ` Segher Boessenkool

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=20181102230320.GV5994@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=bergner@linux.ibm.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=renlin.li@foss.arm.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).