Jan Hubicka writes: >> I'm fine with enlarging tree_function_decl for now - ideally we'd push >> stuff from it elsewhere (like target and optimization option tree nodes, >> or most of the visibility and symbol related stuff). Not sure why >> tree_type_decl inherits from tree_decl_non_common (and thus >> tree_decl_with_vis). Probably because of the non-common parts >> being (ab-)used by FEs. Otherwise I'd say simply put a symtab >> node pointer into tree_decl_with_vis ... (can we move >> section_name and comdat_group more easily than assembler_name?) > > Hi, > this patch removes comdat_group pointer and adds direct symtab pointer. As > expected, the change is not completely easy. The main uglyness in C++'s version > of duplicate_decl that creates a duplicated decl with duplicated symtab node > now and needs to remove it. Other problem is copy_node and c's duplicate_decl > that does memcpy on a node and thus also copie the symtab pointer that is not > the right thing to do. > > On the other hand on middle-end side several things simplify, so I think overall > the approach works relatively well. > > I have bootstrapped/regtested x86_64-linux and I plan to give it more testing > tomorrow and commit if there are no complains. Incrementally I would like then > to cleanup way the decl_with_vis.symtab_node pointer is maintained. I do not > want to allow users to tamper with it, so I did not make accessor macro for > it, however there are more direct uses than I would like: I will need to figure > out how to reduce those. This patch broke Solaris bootstrap: /vol/gcc/src/hg/trunk/local/gcc/config/sol2.c: In function 'void solaris_elf_asm_comdat_section(const char*, unsigned int, tree)': /vol/gcc/src/hg/trunk/local/gcc/config/sol2.c:213:17: error: 'decl_comdat_group' was not declared in this scope /vol/gcc/src/hg/trunk/local/gcc/config/sol2.c: In function 'int solaris_define_comdat_signature(comdat_entry**, void*)': /vol/gcc/src/hg/trunk/local/gcc/config/sol2.c:267:12: error: 'decl_comdat_group' was not declared in this scope The following snippet allows a sparc-sun-solaris2.11 bootstrap to go along further, only to break again later in libjava for what seems to be unrelated reasons. 2014-05-26 Rainer Orth * config/sol2.c: Include cgraph.h.