This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] make stack_slot_list a vec<rtx>


On Thu, Aug 25, 2016 at 10:46:14AM +0200, Bernd Schmidt wrote:
> On 08/25/2016 08:50 AM, tbsaunde+gcc@tbsaunde.org wrote:
> > @@ -2626,8 +2626,10 @@ unshare_all_rtl_1 (rtx_insn *insn)
> >       This special care is necessary when the stack slot MEM does not
> >       actually appear in the insn chain.  If it does appear, its address
> >       is unshared from all else at that point.  */
> > -  stack_slot_list = safe_as_a <rtx_expr_list *> (
> > -		      copy_rtx_if_shared (stack_slot_list));
> > +  unsigned int i;
> > +  rtx temp;
> > +  FOR_EACH_VEC_SAFE_ELT_REVERSE (stack_slot_list, i, temp)
> > +    (*stack_slot_list)[i] = copy_rtx_if_shared (temp);
> >  }
> > 
> >  /* Go through all the RTL insn bodies and copy any invalid shared
> > @@ -2656,7 +2658,10 @@ unshare_all_rtl_again (rtx_insn *insn)
> >    for (decl = DECL_ARGUMENTS (cfun->decl); decl; decl = DECL_CHAIN (decl))
> >      set_used_flags (DECL_RTL (decl));
> > 
> > -  reset_used_flags (stack_slot_list);
> > +  rtx temp;
> > +  unsigned int i;
> > +  FOR_EACH_VEC_SAFE_ELT_REVERSE (stack_slot_list, i, temp)
> > +    reset_used_flags (temp);
> 
> Same here, there doesn't seem to be a reason to go reverse in either of the
> two.

yeah, it was just from being overly careful to not change behavior, but
that's silly we can always revert if it turns out to break something.
Tests passed for this and the other patch, so I'll commit without the
reverse iteration later today.  Thanks for the reviews.

Trev

> 
> 
> Bernd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]