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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-10 
09:36:12 UTC ---
c's vnode is first varpool_mark_needed_node, then it is again marked as not
needed by cgraph_remove_unreachable_nodes (so far both for -O0 and -O1+)
and as nothing like finish_aliases_1 is run afterwards again, the vnode is
!vnode->needed && vnode->force_output.  In -O1 case the varpool node is removed
altogether as not needed (which is strange, the vnode's decl is going to be
emitted anyway), but for -O0:
  /* We must release unused extern inlines or sanity checking will fail.  Rest
of transformations
     are undesirable at -O0 since we do not want to remove anything.  */
  if (!optimize)
    return changed;

  if (file)
    fprintf (file, "Reclaiming variables:");

the reclaiming isn't done, so the vnode remains !vnode->needed and we ICE on it
later on.

I wonder if cgraph_remove_unreachable_nodes shouldn't be somehow alias pairs
aware (can it e.g. call find_aliases_1 again?), or at least for !optimize
shouldn't it avoid clearing vnode->needed for vnode->force_output?

Reply via email to