On Fri, Dec 10, 2021 at 3:57 PM Jeff Law <jeffreya...@gmail.com> wrote:
>
>
>
> On 12/10/2021 8:41 AM, Patrick Palka via Gcc-patches wrote:
> > The function comment for adjust_field_tree_exp says this special case
> > is for handling trees whose operands may contain pointers to RTL instead
> > of to trees.  But ever since r0-59671, which fixed/removed the last two
> > tree codes for which this was possible (GOTO_SUBROUTINE_EXPR and
> > WITH_CLEANUP_EXPR), this special attribute is largely a no-op.
> >
> > This patch removes it and instead just annotates struct tree_exp
> > with the "length" attribute directly.  Not sure it makes a difference,
> > but I use %h instead of %0 in the "length" attribute to be consistent
> > with other structures' "length" attributes within tree-core.h.
> >
> > This changes the code generated for TS_EXP handling in gt-cp-tree.h from:
> >
> >    case TS_EXP:
> >      gt_ggc_m_9tree_node ((*x).generic.exp.typed.type);
> >      switch ((int) (TREE_CODE ((tree) &(*x))))
> >        {
> >        default:
> >       {
> >         size_t i3;
> >         size_t l3 = (size_t)(TREE_OPERAND_LENGTH ((tree) &(*x)));
> >         for (i3 = 0; i3 != l3; i3++) {
> >           gt_ggc_m_9tree_node ((*x).generic.exp.operands[i3]);
> >         }
> >       }
> >       break;
> >        }
> >      break;
> >
> > to:
> >
> >    case TS_EXP:
> >      {
> >        size_t l3 = (size_t)(TREE_OPERAND_LENGTH 
> > ((tree)&((*x).generic.exp)));
> >        gt_ggc_m_9tree_node ((*x).generic.exp.typed.type);
> >        {
> >       size_t i3;
> >       for (i3 = 0; i3 != l3; i3++) {
> >         gt_ggc_m_9tree_node ((*x).generic.exp.operands[i3]);
> >       }
> >        }
> >      }
> >
> > which seems equivalent and simpler.
> >
> > Boostrapped and regtested on x86_64-pc-linux-gnu, does this look OK for 
> > trunk?
> >
> > gcc/ChangeLog:
> >
> >       * gengtype.c (adjust_field_tree_exp): Remove.
> >       (adjust_field_type): Don't handle the "tree_exp" special attribute.
> >       * tree-core.h (struct tree_exp): Replace special and desc
> >       attributes with length.
> Should this wait until stage1 reopens?  It doesn't seem like a bugfix.

Yes sorry, I should have clarified that this isn't a bugfix, only a
minor cleanup.  I'll try to remember to ping this when stage1 reopens.

>
> jeff
>

Reply via email to