tree-inline.c (tree_function_versioning): Call cgraph_get_node instead of cgraph_node...
authorMartin Jambor <mjambor@suse.cz>
Tue, 12 Apr 2011 09:12:58 +0000 (11:12 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 12 Apr 2011 09:12:58 +0000 (11:12 +0200)
2011-04-12  Martin Jambor  <mjambor@suse.cz>

* tree-inline.c (tree_function_versioning): Call cgraph_get_node
instead of cgraph_node and assert it does not return NULL.
* lto-streamer-in.c (lto_read_body): Likewise.
* omp-low.c (new_omp_context): Likewise.
(create_task_copyfn): Likewise.
* tree-emutls.c (lower_emutls_function_body): Likewise.
* matrix-reorg.c (transform_allocation_sites): Likewise.

From-SVN: r172306

gcc/ChangeLog
gcc/lto-streamer-in.c
gcc/matrix-reorg.c
gcc/omp-low.c
gcc/tree-emutls.c
gcc/tree-inline.c

index 3fe9cdb6214c092bd3459b799dfe03abc9012693..445317d1befee587da1497399d5de93e9040e361 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-12  Martin Jambor  <mjambor@suse.cz>
+
+       * tree-inline.c (tree_function_versioning): Call cgraph_get_node
+       instead of cgraph_node and assert it does not return NULL.
+       * lto-streamer-in.c (lto_read_body): Likewise.
+       * omp-low.c (new_omp_context): Likewise.
+       (create_task_copyfn): Likewise.
+       * tree-emutls.c (lower_emutls_function_body): Likewise.
+       * matrix-reorg.c (transform_allocation_sites): Likewise.
+
 2011-04-12  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/48552
index fc5bc637f3829576d4cf79c62009cbf5e2ed5f04..c95a8e11f956648824cb36ccf7d7de8c739527c8 100644 (file)
@@ -1446,8 +1446,9 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
     {
       struct function *fn = DECL_STRUCT_FUNCTION (fn_decl);
       struct lto_in_decl_state *decl_state;
-      struct cgraph_node *node = cgraph_node (fn_decl);
+      struct cgraph_node *node = cgraph_get_node (fn_decl);
 
+      gcc_checking_assert (node);
       push_cfun (fn);
       init_tree_ssa (fn);
 
index d2d4fa181c612aed3ab6261c2eb30650571d308c..44daa27c1f7cb7e71e37e391e9f86886b0691b4b 100644 (file)
@@ -2169,7 +2169,8 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
   update_ssa (TODO_update_ssa);
   /* Replace the malloc size argument in the malloc of level 0 to be
      the size of all the dimensions.  */
-  c_node = cgraph_node (mi->allocation_function_decl);
+  c_node = cgraph_get_node (mi->allocation_function_decl);
+  gcc_checking_assert (c_node);
   old_size_0 = gimple_call_arg (call_stmt_0, 0);
   tmp = force_gimple_operand_gsi (&gsi, mi->dimension_size[0], true,
                                  NULL, true, GSI_SAME_STMT);
@@ -2218,7 +2219,8 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
       if (!mi->free_stmts[i].stmt)
        continue;
 
-      c_node = cgraph_node (mi->free_stmts[i].func);
+      c_node = cgraph_get_node (mi->free_stmts[i].func);
+      gcc_checking_assert (c_node);
       gcc_assert (is_gimple_call (mi->free_stmts[i].stmt));
       e = cgraph_edge (c_node, mi->free_stmts[i].stmt);
       gcc_assert (e);
index c3f217818bcb5c70cd0b2969b4279f2ca731800f..8b2412cca1a5931845753e8ae473ce539f19b914 100644 (file)
@@ -1209,7 +1209,8 @@ new_omp_context (gimple stmt, omp_context *outer_ctx)
     {
       ctx->cb.src_fn = current_function_decl;
       ctx->cb.dst_fn = current_function_decl;
-      ctx->cb.src_node = cgraph_node (current_function_decl);
+      ctx->cb.src_node = cgraph_get_node (current_function_decl);
+      gcc_checking_assert (ctx->cb.src_node);
       ctx->cb.dst_node = ctx->cb.src_node;
       ctx->cb.src_cfun = cfun;
       ctx->cb.copy_decl = omp_copy_decl;
@@ -6263,7 +6264,8 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
       memset (&tcctx, '\0', sizeof (tcctx));
       tcctx.cb.src_fn = ctx->cb.src_fn;
       tcctx.cb.dst_fn = child_fn;
-      tcctx.cb.src_node = cgraph_node (tcctx.cb.src_fn);
+      tcctx.cb.src_node = cgraph_get_node (tcctx.cb.src_fn);
+      gcc_checking_assert (tcctx.cb.src_node);
       tcctx.cb.dst_node = tcctx.cb.src_node;
       tcctx.cb.src_cfun = ctx->cb.src_cfun;
       tcctx.cb.copy_decl = task_copyfn_copy_decl;
index 899888dfb10c523a6d63d689fee815ee4b2d0fe9..cc01fb3943841ca39d0110c4a7fba8d29f9c699d 100644 (file)
@@ -619,7 +619,8 @@ lower_emutls_function_body (struct cgraph_node *node)
 
   d.cfun_node = node;
   d.builtin_decl = built_in_decls[BUILT_IN_EMUTLS_GET_ADDRESS];
-  d.builtin_node = cgraph_node (d.builtin_decl);
+  d.builtin_node = cgraph_get_node (d.builtin_decl);
+  gcc_checking_assert (d.builtin_node);
 
   FOR_EACH_BB (d.bb)
     {
index 9f86204ecff2dc7683309f27c045d9263ecba503..0ba8e4e84bb20f2fa71a3f66079f68aa5538d5c9 100644 (file)
@@ -5001,8 +5001,10 @@ tree_function_versioning (tree old_decl, tree new_decl,
              && TREE_CODE (new_decl) == FUNCTION_DECL);
   DECL_POSSIBLY_INLINED (old_decl) = 1;
 
-  old_version_node = cgraph_node (old_decl);
-  new_version_node = cgraph_node (new_decl);
+  old_version_node = cgraph_get_node (old_decl);
+  gcc_checking_assert (old_version_node);
+  new_version_node = cgraph_get_node (new_decl);
+  gcc_checking_assert (new_version_node);
 
   /* Output the inlining info for this abstract function, since it has been
      inlined.  If we don't do this now, we can lose the information about the