------- Comment #14 from jakub at gcc dot gnu dot org 2006-04-20 12:04 ------- The reversal of the DECL_UID (x) = DECL_UID (t); assignment in name-lookup.c causes FAIL: g++.dg/opt/inline2.C (test for excess errors) as well as // { dg-do link } // { dg-options "-O1" }
static int g; void f() { extern int g; g++; } int main () { f (); } regression. For some of the duplicate decls in different binding levels I'm pretty sure we could just duplicate_decls instead of keeping two decls around, but as the comment explains e.g. for static int g (int x, int y = 8); void f () { int g (int x, int y = 12); g (6); } int g (int x, int y) { return x + y; } int main () { f (); g (6); } we need two decls, at least throughout the frontend. On the other side, the two decls are really supposed to share all cgraph {,varpool} node properties, except the decl itself (and uid), so I wonder if we couldn't have indirect nodes in cgraph_hash and cgraph_varpool_hash or something similar for this purpose. -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26757