OSDN Git Service

PR c++/27804
[pf3gnuchains/gcc-fork.git] / gcc / ipa.c
index fe1055d..44b0456 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -15,8 +15,8 @@ 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, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -36,7 +36,7 @@ cgraph_postorder (struct cgraph_node **order)
   struct cgraph_edge *edge, last;
 
   struct cgraph_node **stack =
-    xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *));
+    XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
 
   /* We have to deal with cycles nicely, so use a depth first traversal
      output algorithm.  Ignore the fact that some functions won't need
@@ -83,6 +83,8 @@ cgraph_postorder (struct cgraph_node **order)
          }
       }
   free (stack);
+  for (node = cgraph_nodes; node; node = node->next)
+    node->aux = NULL;
   return order_pos;
 }
 
@@ -92,7 +94,7 @@ cgraph_postorder (struct cgraph_node **order)
    removes unneeded bodies of extern inline functions.  */
 
 bool
-cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *dump_file)
+cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
 {
   struct cgraph_node *first = (void *) 1;
   struct cgraph_node *node;
@@ -102,8 +104,8 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *dump_file)
 #ifdef ENABLE_CHECKING
   verify_cgraph ();
 #endif
-  if (dump_file)
-    fprintf (dump_file, "\nReclaiming functions:");
+  if (file)
+    fprintf (file, "\nReclaiming functions:");
 #ifdef ENABLE_CHECKING
   for (node = cgraph_nodes; node; node = node->next)
     gcc_assert (!node->aux);
@@ -161,8 +163,8 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *dump_file)
            local_insns = node->local.self_insns;
          else
            local_insns = 0;
-         if (dump_file)
-           fprintf (dump_file, " %s", cgraph_node_name (node));
+         if (file)
+           fprintf (file, " %s", cgraph_node_name (node));
          if (!node->analyzed || !DECL_EXTERNAL (node->decl)
              || before_inlining_p)
            cgraph_remove_node (node);
@@ -201,7 +203,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *dump_file)
     }
   for (node = cgraph_nodes; node; node = node->next)
     node->aux = NULL;
-  if (dump_file)
-    fprintf (dump_file, "\nReclaimed %i insns", insns);
+  if (file)
+    fprintf (file, "\nReclaimed %i insns", insns);
   return changed;
 }