diff mbox

[RFC] Preferred rename register in regrename pass

Message ID B5E67142681B53468FAF6B7C31356562442C4257@hhmail02.hh.imgtec.org
State New
Headers show

Commit Message

Robert Suchanek Nov. 11, 2015, 8:50 a.m. UTC
Hi,

> I guess this is ok to stop the failures for now, but you may want to
> move the check to the point where we set terminated_this_insn. Also, as
> I pointed out earlier, clearing terminated_this_insn should probably
> happen earlier.

Here is the updated patch that I'm about to commit once the bootstrap
finishes.

Regards,
Robert

gcc/
	* regname.c (scan_rtx_reg): Check the matching number of consecutive
	registers when tying chains.
	(build_def_use): Move terminated_this_insn earlier in the function.
---
 gcc/regrename.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Christophe Lyon Nov. 12, 2015, 7:47 a.m. UTC | #1
On 11 November 2015 at 09:50, Robert Suchanek
<Robert.Suchanek@imgtec.com> wrote:
> Hi,
>
>> I guess this is ok to stop the failures for now, but you may want to
>> move the check to the point where we set terminated_this_insn. Also, as
>> I pointed out earlier, clearing terminated_this_insn should probably
>> happen earlier.
>
> Here is the updated patch that I'm about to commit once the bootstrap
> finishes.
>
Hi,
I confirm that this fixes the build errors I was seeing.
Thanks.

> Regards,
> Robert
>
> gcc/
>         * regname.c (scan_rtx_reg): Check the matching number of consecutive
>         registers when tying chains.
>         (build_def_use): Move terminated_this_insn earlier in the function.
> ---
>  gcc/regrename.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/regrename.c b/gcc/regrename.c
> index d727dd9..d41410a 100644
> --- a/gcc/regrename.c
> +++ b/gcc/regrename.c
> @@ -1068,7 +1068,9 @@ scan_rtx_reg (rtx_insn *insn, rtx *loc, enum reg_class cl, enum scan_actions act
>               && GET_CODE (pat) == SET
>               && GET_CODE (SET_DEST (pat)) == REG
>               && GET_CODE (SET_SRC (pat)) == REG
> -             && terminated_this_insn)
> +             && terminated_this_insn
> +             && terminated_this_insn->nregs
> +                == REG_NREGS (recog_data.operand[1]))
>             {
>               gcc_assert (terminated_this_insn->regno
>                           == REGNO (recog_data.operand[1]));
> @@ -1593,6 +1595,7 @@ build_def_use (basic_block bb)
>           enum rtx_code set_code = SET;
>           enum rtx_code clobber_code = CLOBBER;
>           insn_rr_info *insn_info = NULL;
> +         terminated_this_insn = NULL;
>
>           /* Process the insn, determining its effect on the def-use
>              chains and live hard registers.  We perform the following
> @@ -1749,8 +1752,6 @@ build_def_use (basic_block bb)
>               scan_rtx (insn, &XEXP (note, 0), ALL_REGS, mark_read,
>                         OP_INOUT);
>
> -         terminated_this_insn = NULL;
> -
>           /* Step 4: Close chains for registers that die here, unless
>              the register is mentioned in a REG_UNUSED note.  In that
>              case we keep the chain open until step #7 below to ensure
> --
> 2.4.
Robert Suchanek Nov. 12, 2015, 12:57 p.m. UTC | #2
Hi Christophe,

> >

> Hi,

> I confirm that this fixes the build errors I was seeing.

> Thanks.

> 


Thanks for checking this.

I'm still seeing a number of ICEs on the gcc-testresults mailing list
across various ports but these are likely to be caused another patch.
They are already reported as PR68293 and PR68296.

Regards,
Robert
diff mbox

Patch

diff --git a/gcc/regrename.c b/gcc/regrename.c
index d727dd9..d41410a 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1068,7 +1068,9 @@  scan_rtx_reg (rtx_insn *insn, rtx *loc, enum reg_class cl, enum scan_actions act
 	      && GET_CODE (pat) == SET
 	      && GET_CODE (SET_DEST (pat)) == REG
 	      && GET_CODE (SET_SRC (pat)) == REG
-	      && terminated_this_insn)
+	      && terminated_this_insn
+	      && terminated_this_insn->nregs
+		 == REG_NREGS (recog_data.operand[1]))
 	    {
 	      gcc_assert (terminated_this_insn->regno
 			  == REGNO (recog_data.operand[1]));
@@ -1593,6 +1595,7 @@  build_def_use (basic_block bb)
 	  enum rtx_code set_code = SET;
 	  enum rtx_code clobber_code = CLOBBER;
 	  insn_rr_info *insn_info = NULL;
+	  terminated_this_insn = NULL;
 
 	  /* Process the insn, determining its effect on the def-use
 	     chains and live hard registers.  We perform the following
@@ -1749,8 +1752,6 @@  build_def_use (basic_block bb)
 	      scan_rtx (insn, &XEXP (note, 0), ALL_REGS, mark_read,
 			OP_INOUT);
 
-	  terminated_this_insn = NULL;
-
 	  /* Step 4: Close chains for registers that die here, unless
 	     the register is mentioned in a REG_UNUSED note.  In that
 	     case we keep the chain open until step #7 below to ensure