http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48508
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | --- Comment #14 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-14 15:23:18 UTC --- Hm. It seems that unlike the C FE the C++ FE emits new global fndecls for each block-local extern it encounters. So, for extern void foo (int); static void bar (void) { extern void foo (int); foo (0); } int main() { extern void foo (int); bar (); } we'll have three FUNCTION_DECLs for the global foo, two queued in BLOCK_VARS but with global context (the C FE would have a DECL_CONTEXT of the enclosing function declaration, bar and main here). So the C++ frontend will be still susceptible to PR48437, those local decls entering the decl merging process. Which means that if we fix this bug in another way this bug is fixed as well! One idea is to simply never treat trees that we output when following TREE_CHAIN as indexable.