[MIPS] Fix PR/target 90357 20080502-1.c -O0 start with r269880

Message ID CAKjxQHka8GqUeyFEjaOqBJhgtDbDm0w-3tJHJ+7h9PH4mDS+UQ@mail.gmail.com
State New
Headers show
Series
  • [MIPS] Fix PR/target 90357 20080502-1.c -O0 start with r269880
Related show

Commit Message

Paul Hua May 6, 2019, 8:34 a.m.
The attached patch fix pr90357, bootstraped and regressed test on
mips64el-linux-gnu target.
Ok for commit ?

Comments

Paul Hua May 10, 2019, 12:52 a.m. | #1
ping ?

On Mon, May 6, 2019 at 4:34 PM Paul Hua <paul.hua.gm@gmail.com> wrote:
>

> The attached patch fix pr90357, bootstraped and regressed test on

> mips64el-linux-gnu target.

> Ok for commit ?
Jeff Law May 13, 2019, 7:07 p.m. | #2
On 5/6/19 2:34 AM, Paul Hua wrote:
> The attached patch fix pr90357, bootstraped and regressed test on

> mips64el-linux-gnu target.

> Ok for commit ?

> 

> 

> 0001-PATCH-MIPS-Skip-forward-src-into-next-insn-when-the-.patch

> 

> From a3db8763ee8460a5f63c567d58624a985f9924ce Mon Sep 17 00:00:00 2001

> From: Chenghua Xu <paul.hua.gm@gmail.com>

> Date: Mon, 6 May 2019 16:14:56 +0800

> Subject: [PATCH] [PATCH,MIPS] Skip forward src into next insn when the SRC reg

>  is dead.

> 

> 	PR target/90357

> 	gcc/

> 	* config/mips/mips.c (mips_split_move): Skip forward SRC into

> 	next insn when the SRC reg is dead.

OK.  Sorry for the breakage.

jeff

Patch

From a3db8763ee8460a5f63c567d58624a985f9924ce Mon Sep 17 00:00:00 2001
From: Chenghua Xu <paul.hua.gm@gmail.com>
Date: Mon, 6 May 2019 16:14:56 +0800
Subject: [PATCH] [PATCH,MIPS] Skip forward src into next insn when the SRC reg
 is dead.

	PR target/90357
	gcc/
	* config/mips/mips.c (mips_split_move): Skip forward SRC into
	next insn when the SRC reg is dead.
---
 gcc/config/mips/mips.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 1de33b2..89fc073 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -4849,6 +4849,7 @@  mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_)
      can forward SRC for DEST.  This is most useful if the next insn is a
      simple store.   */
   rtx_insn *insn = (rtx_insn *)insn_;
+  struct mips_address_info addr;
   if (insn)
     {
       rtx_insn *next = next_nonnote_nondebug_insn_bb (insn);
@@ -4856,7 +4857,17 @@  mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_)
 	{
 	  rtx set = single_set (next);
 	  if (set && SET_SRC (set) == dest)
-	    validate_change (next, &SET_SRC (set), src, false);
+	    {
+	      if (MEM_P (src))
+		{
+		  rtx tmp = XEXP (src, 0);
+		  mips_classify_address (&addr, tmp, GET_MODE (tmp), true);
+		  if (REGNO (addr.reg) != REGNO (dest))
+		    validate_change (next, &SET_SRC (set), src, false);
+		}
+	      else
+		validate_change (next, &SET_SRC (set), src, false);
+	    }
 	}
     }
 }
-- 
1.8.3.1