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: RFA: PATCH to gengtype to avoid putting tree_node support in front end objects


On Thu, Oct 27, 2016 at 09:36:09AM -0400, Jason Merrill wrote:
> Currently, the way gengtype works it scans the list of source files
> with front end files at the end, and pushes data structures onto a
> stack.  It then processes the stack in LIFO order, so that data
> structures from front ends are handled first.  As a result, if a GTY
> data structure in a front end depends on tree_node, gengtype happily
> puts gt_ggc_mx(tree_node*&) in a front end file, leading to link
> errors on all other front ends.
> 
> This patch avoids this problem by appending to the list of data
> structures so that they are processed in FIFO order, and so tree_node
> gets handled in gtype-desc.o.
> 
> Tested x86_64-pc-linux-gnu, OK for trunk?

> commit 487a1c95c0d3169b2041942ff4f8d71c9ff689eb
> Author: Jason Merrill <jason@redhat.com>
> Date:   Wed Oct 26 23:12:23 2016 -0400
> 
>             * gengtype.c (new_structure): Append to structures list.
>     
>             (find_structure): Likewise.

Please remove the blank line in the ChangeLog.

When looking at the differences it creates, it is hard, because
all the generated files have all the functions emitted in reverse order now
from what it used to be, so I only looked at files where the size changed,
and that is beyond gtype.state only in my case gt-tree-phinodes.h
which lost
void
gt_ggc_mx (struct gimple *& x)
{
  if (x)
    gt_ggc_mx_gimple ((void *) x);
}
and
void
gt_pch_nx (struct gimple *& x)
{
  if (x)
    gt_pch_nx_gimple ((void *) x);
}
and gtype-desc.c which didn't contain those but now it does (for
gtype-desc.c it is hard to find out due to the reordering what else
has changed, but as gt-tree-phinodes.h shrunk by 170 characters and
gtype-desc.c grew by 170 characters, I'd think it is all that changed).
I believe those routines belong to gtype-desc.c, that is where similar
ones for tree_node, etc. are, tree-phinodes.h certainly isn't the header
that defines gimple.

So I think this patch is ok for trunk.  Thanks.

	Jakub


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