public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Patrick Palka <ppalka@redhat.com>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] gengtype: remove "tree_exp" special attribute
Date: Sat, 11 Dec 2021 11:20:28 -0500	[thread overview]
Message-ID: <CAMOnLZZHP1PzAmAhkcMAnH2C2ccgM9zMwE+QW8AfRTtnxN2gKQ@mail.gmail.com> (raw)
In-Reply-To: <f01afaf9-c1c0-08e0-5e11-5845d168cb40@gmail.com>

On Fri, Dec 10, 2021 at 3:57 PM Jeff Law <jeffreyalaw@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	other threads:[~2021-12-11 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 15:41 Patrick Palka
2021-12-10 20:57 ` Jeff Law
2021-12-11 16:20   ` Patrick Palka [this message]
2021-12-15 22:10 ` Jason Merrill
2022-04-30 15:03   ` Patrick Palka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMOnLZZHP1PzAmAhkcMAnH2C2ccgM9zMwE+QW8AfRTtnxN2gKQ@mail.gmail.com \
    --to=ppalka@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).