From: Jan Hubicka Date: Tue, 16 Jan 2007 23:42:06 +0000 (+0100) Subject: tree-ssanames.c (release_dead_ssa_names): Instead of ggc_freeing the names... X-Git-Tag: releases/gcc-4.3.0~7463 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=109c8d3934b3748a2fdb061c9a250b30b54fdf5b;p=thirdparty%2Fgcc.git tree-ssanames.c (release_dead_ssa_names): Instead of ggc_freeing the names... * tree-ssanames.c (release_dead_ssa_names): Instead of ggc_freeing the names, just unlink the chain so we don't crash on dangling pointers to dead SSA names. From-SVN: r120837 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7d44816fc9e4..a8e0c18d8348 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-01-16 Jan Hubicka + + * tree-ssanames.c (release_dead_ssa_names): Instead of ggc_freeing + the names, just unlink the chain so we don't crash on dangling pointers + to dead SSA names. + 2007-01-16 Jan Hubicka * cgraph.h (cgraph_decide_inlining_incrementally): Kill. diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index d9ab940fa90a..07b83f831afc 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -325,7 +325,12 @@ release_dead_ssa_names (void) for (t = FREE_SSANAMES (cfun); t; t = next) { next = TREE_CHAIN (t); - ggc_free (t); + /* Dangling pointers might make GGC to still see dead SSA names, so it is + important to unlink the list and avoid GGC from seeing all subsequent + SSA names. In longer run we want to have all dangling pointers here + removed (since they usually go trhough dead statements that consume + considerable amounts of memory). */ + TREE_CHAIN (t) = NULL_TREE; n++; } FREE_SSANAMES (cfun) = NULL;