http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53426
--- Comment #8 from Jan Hubicka <hubicka at ucw dot cz> 2012-05-22 12:53:43 UTC --- > But I have a variable that fulfills varpool_all_refs_explicit_p but still > its DECL_INITIAL contains &X where I have no varpool node for X for. So > if I constant fold from it I can get an explicit reference to a global > variable X that has no varpool node assigned. How can that be ok? We bring the references only for vars that pass const_value_known_p, but from what you quote it looks like it should pass the check. I am now tracking memory corruption in other PR, so i will look into this next.