OSDN Git Service

* value-prof.c (init_pid_map): Replace xmalloc with XCNEWVEC.
[pf3gnuchains/gcc-fork.git] / gcc / value-prof.c
index fac124f..9774ca2 100644 (file)
@@ -1,5 +1,5 @@
 /* Transformations based on profile information for values.
-   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software
    Foundation, Inc.
 
 This file is part of GCC.
@@ -474,9 +474,9 @@ check_counter (gimple stmt, const char * name,
        }
       else
        {
-         error ("%HCorrupted value profile: %s profiler overall count (%d) "
-                 "does not match BB count (%d)", &locus, name, (int)*all,
-                 (int)bb_count);
+         error_at (locus, "Corrupted value profile: %s "
+                   "profiler overall count (%d) does not match BB count (%d)",
+                   name, (int)*all, (int)bb_count);
          return true;
        }
     }
@@ -1059,8 +1059,7 @@ init_pid_map (void)
   if (pid_map != NULL)
     return;
 
-  pid_map 
-    = (struct cgraph_node**) xmalloc (sizeof (struct cgraph_node*) * cgraph_max_pid);
+  pid_map = XCNEWVEC (struct cgraph_node*, cgraph_max_pid);
 
   for (n = cgraph_nodes; n; n = n->next)
     {
@@ -1117,8 +1116,7 @@ gimple_ic (gimple stmt, gimple call, struct cgraph_node *direct_call,
   bb1end = stmt3;
 
   stmt1 = gimple_copy (stmt);
-  gimple_call_set_fn (stmt,
-                     build_addr (direct_call->decl, current_function_decl));
+  gimple_call_set_fndecl (stmt1, direct_call->decl);
   gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
   bb2end = stmt1;
   bb3end = stmt;
@@ -1297,7 +1295,7 @@ gimple_stringop_fixed_value (gimple stmt, tree value, int prob, gcov_type count,
     {
       edge_iterator ei;
       for (ei = ei_start (bb->succs); (e34 = ei_safe_edge (ei)); )
-       if (!e34->flags & EDGE_ABNORMAL)
+       if (!(e34->flags & EDGE_ABNORMAL))
          break;
     }
   else