/* Generic routines for manipulating SSA_NAME expressions
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
if (!ptr_info)
return;
- new_ptr_info = ggc_alloc (sizeof (struct ptr_info_def));
+ new_ptr_info = GGC_NEW (struct ptr_info_def);
*new_ptr_info = *ptr_info;
if (ptr_info->pt_vars)
referenced_var_iterator rvi;
/* Current defs point to various dead SSA names that in turn points to dead
- statements so bunch of dead memory is holded from releasing. */
+ statements so bunch of dead memory is held from releasing. */
FOR_EACH_REFERENCED_VAR (t, rvi)
set_current_def (t, NULL);
/* Now release the freelist. */
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 through dead statements that consume
+ considerable amounts of memory). */
+ TREE_CHAIN (t) = NULL_TREE;
n++;
}
FREE_SSANAMES (cfun) = NULL;