> -----Original Message----- > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- > ow...@gcc.gnu.org] On Behalf Of Jakub Jelinek > Sent: Thursday, November 10, 2016 7:53 AM > To: Jason Merrill <ja...@redhat.com> > Cc: gcc-patches List <gcc-patches@gcc.gnu.org> > Subject: 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 <ja...@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. >
Hi -- This patch caused breakage for the MIPS port while compiling gcc/config/mips.c: In file included from /scratch/cmoore/mips-sde-elf-upstream/src/gcc-trunk-6/gcc/hash-table.h:561:0, from /scratch/cmoore/mips-sde-elf-upstream/src/gcc-trunk-6/gcc/coretypes.h:351, from /scratch/cmoore/mips-sde-elf-upstream/src/gcc-trunk-6/gcc/config/mips/mips.c:26: /scratch/cmoore/mips-sde-elf-upstream/src/gcc-trunk-6/gcc/hash-map.h: In instantiation of 'static void hash_map< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::hash_entry::ggc_mx(hash_map< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3> >::hash_entry&) [with KeyId = nofree_string_hash; Value = rtx_def*; Traits = simple_hashmap_traits<default_hash_traits<nofree_string_hash>, rtx_def*>]': /scratch/cmoore/mips-sde-elf-upstream/src/gcc-trunk-6/gcc/hash-table.h:1029:17: required from 'void gt_ggc_mx(hash_table<E>*) [with E = hash_map<nofree_string_hash, rtx_def*>::hash_entry]' /scratch/cmoore/mips-sde-elf-upstream/src/gcc-trunk-6/gcc/hash-map.h:251:13: required from 'void gt_ggc_mx(hash_map<K, V, H>*) [with K = nofree_string_hash; V = rtx_def*; H = simple_hashmap_traits<default_hash_traits<nofree_string_hash>, rtx_def*>]' ./gt-mips.h:38:19: required from here /scratch/cmoore/mips-sde-elf-upstream/src/gcc-trunk-6/gcc/hash-map.h:62:12: error: no matching function for call to 'gt_ggc_mx(rtx_def*&)' gt_ggc_mx (e.m_value); ^ ... etc I configured with --target=mips-sde-elf, but I do have some local multilib definitions for that target. This ought to reproduce with mti-elf as well. Will you please fix or revert? Thanks, Catherine