[Bug lto/51573] [4.7 Regression] ICE (segfault) in lto_varpool_encoder_encode_initializer_p

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 16 12:17:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51573

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-16 12:13:55 UTC ---
It's a really messed up situation as with the C++ units

void
bar1 (void)
{
  extern void foo (int);
  foo (0);
}

---

void
bar2 (void)
{
  extern void foo (int);
  foo (0);
}

---

void foo (int) {}

we _do_ need to enter the function local foo's for decl/cgraph merging.
But OTOH we cannot, as the merged decl can only appear in one BLOCK_VARS
list.  ISTM that either the frontends should move those over to
BLOCK_NONLOCALIZED_DECLS or all frontends consistently need to put a
decl copy in BLOCK_VARS for the sake of debuginfo (still using the
global-scope decl for the actual call) - that is what the C frontend
is doing and that works quite well.

Jason?  Can we please change the C++ frontend to mimic what the C
frontend does here?  See c-decl.c:1199ff.

I'm testing another (temporary?) workaround, still prone to the above
issue.



More information about the Gcc-bugs mailing list