Hi DJ,

>>Do you have checkin privs yet?
I have filled out the form. "Thanks for your request. It must be approved by 
the person you named as approver ...

>> This is ok aside from..
Sorry about this. I will keep this in mind in future.
I corrected the patch with your second suggestion.

Best Regards,
Sebastian

Index: ChangeLog
===================================================================
--- ChangeLog(revision 256590)
+++ ChangeLog(working copy)
@@ -1,3 +1,8 @@
+2018-01-12  Sebastian Perta  <sebastian.pe...@renesas.com>
+
+* config/rl78/rl78.c (rl78_note_reg_set): fixed dead reg check
+for non-QImode registers
+
 2018-01-12  Vladimir Makarov  <vmaka...@redhat.com>

 PR rtl-optimization/80481
Index: config/rl78/rl78.c
===================================================================
--- config/rl78/rl78.c(revision 256590)
+++ config/rl78/rl78.c(working copy)
@@ -3792,7 +3792,7 @@
 rl78_note_reg_set (char *dead, rtx d, rtx insn)
 {
   int r, i;
-
+  bool is_dead;
   if (GET_CODE (d) == MEM)
     rl78_note_reg_uses (dead, XEXP (d, 0), insn);

@@ -3799,9 +3799,15 @@
   if (GET_CODE (d) != REG)
     return;

+ /* Do not mark the reg unused unless all QImode parts of it are dead.  */
   r = REGNO (d);
-  if (dead [r])
-    add_reg_note (insn, REG_UNUSED, gen_rtx_REG (GET_MODE (d), r));
+  is_dead = true;
+  for (i = 0; i < GET_MODE_SIZE (GET_MODE (d)); i ++)
+  if (!dead [r + i])
+  is_dead = false;
+  if(is_dead)
+add_reg_note (insn, REG_UNUSED, gen_rtx_REG (GET_MODE (d), r));
   if (dump_file)
     fprintf (dump_file, "note set reg %d size %d\n", r, GET_MODE_SIZE 
(GET_MODE (d)));
   for (i = 0; i < GET_MODE_SIZE (GET_MODE (d)); i ++)

> -----Original Message-----
> From: DJ Delorie [mailto:d...@redhat.com]
> Sent: 12 January 2018 18:12
> To: Sebastian Perta <sebastian.pe...@renesas.com>
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] RL78 UNUSED note setting bug fix in rl78_note_reg_set
>
>
> "Sebastian Perta" <sebastian.pe...@renesas.com> writes:
> > Please let me know if this is OK. Thank you!
>
> Do you have checkin privs yet?
>
> This is ok aside from..
>
> > +  /* 'dead' keeps track of the QImode registers if r is of different size
> > +  we need to check the other subparts as well  */
>
> Missing period at the end of a sentence; should capitalize first word
> but it's a variable, which should be block caps anyway, and it reads
> better as two sentences:
>
> > +  /* DEAD keeps track of the QImode registers.  If R is of different size
> > +  we need to check the other subparts as well.  */
>
> Or rewrite to not mention variables?
>
> > + /* Do not mark the reg unused unless all QImode parts of it are dead.  */



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, 
Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered 
No. 04586709.

Reply via email to