]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/58723 (ICE in lto_output_edge, at lto-cgraph.c:300 for OpenMP's...
authorRichard Biener <rguenther@suse.de>
Wed, 27 Nov 2013 15:18:23 +0000 (15:18 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 27 Nov 2013 15:18:23 +0000 (15:18 +0000)
2013-11-27  Richard Biener  <rguenther@suse.de>

PR middle-end/58723
* cgraphbuild.c (build_cgraph_edges): Do not build edges
for internal calls.
(rebuild_cgraph_edges): Likewise.
* ipa-inline-analysis.c (estimate_function_body_sizes):
Skip internal calls.
* tree-inline.c (estimate_num_insns): Estimate size of internal
calls as 0.
(gimple_expand_calls_inline): Do not try inline-expanding
internal calls.
* lto-streamer-in.c (input_cfg): Stream loop safelen,
force_vect and simduid.
(input_struct_function_base): Stream has_force_vect_loops
and has_simduid_loops.
(input_function): Adjust.
* lto-streamer-out.c (output_cfg): Stream loop safelen,
force_vect and simduid.
(output_struct_function_base): Stream has_force_vect_loops
and has_simduid_loops.

From-SVN: r205447

gcc/ChangeLog
gcc/cgraphbuild.c
gcc/ipa-inline-analysis.c
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c
gcc/tree-inline.c

index 3476e484adaea17a78e19990d0d5d4160a9bc436..3899f7e40c5ca287e1f8d5c235b04442c72e07da 100644 (file)
@@ -1,3 +1,25 @@
+2013-11-27  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/58723
+       * cgraphbuild.c (build_cgraph_edges): Do not build edges
+       for internal calls.
+       (rebuild_cgraph_edges): Likewise.
+       * ipa-inline-analysis.c (estimate_function_body_sizes):
+       Skip internal calls.
+       * tree-inline.c (estimate_num_insns): Estimate size of internal
+       calls as 0.
+       (gimple_expand_calls_inline): Do not try inline-expanding
+       internal calls.
+       * lto-streamer-in.c (input_cfg): Stream loop safelen,
+       force_vect and simduid.
+       (input_struct_function_base): Stream has_force_vect_loops
+       and has_simduid_loops.
+       (input_function): Adjust.
+       * lto-streamer-out.c (output_cfg): Stream loop safelen,
+       force_vect and simduid.
+       (output_struct_function_base): Stream has_force_vect_loops
+       and has_simduid_loops.
+
 2013-11-27  Kai Tietz  <ktietz@redhat.com>
 
        * config/i386/winnt.c (i386_pe_section_type_flags): Use const
index b6cafffac8dcf015ec42504d0214a6633acf0f4f..9a63982d9cbdc0bed4f315e1c10ea9d3ab96f281 100644 (file)
@@ -335,6 +335,8 @@ build_cgraph_edges (void)
              if (decl)
                cgraph_create_edge (node, cgraph_get_create_node (decl),
                                    stmt, bb->count, freq);
+             else if (gimple_call_internal_p (stmt))
+               ;
              else
                cgraph_create_indirect_edge (node, stmt,
                                             gimple_call_flags (stmt),
@@ -464,6 +466,8 @@ rebuild_cgraph_edges (void)
              if (decl)
                cgraph_create_edge (node, cgraph_get_create_node (decl), stmt,
                                    bb->count, freq);
+             else if (gimple_call_internal_p (stmt))
+               ;
              else
                cgraph_create_indirect_edge (node, stmt,
                                             gimple_call_flags (stmt),
index a570883bebc8f7b888f2527ff997f8e7d39c4b5a..ad6fe8febb65a3adb911155836b19652be547c44 100644 (file)
@@ -2502,7 +2502,8 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early)
            }
 
 
-         if (is_gimple_call (stmt))
+         if (is_gimple_call (stmt)
+             && !gimple_call_internal_p (stmt))
            {
              struct cgraph_edge *edge = cgraph_edge (node, stmt);
              struct inline_edge_summary *es = inline_edge_summary (edge);
index 333e815a97d93490bd617aacbaa8e765e784425c..c5cb23c95d3203fc84b67ebf1947ae11d3aca692 100644 (file)
@@ -598,7 +598,8 @@ make_new_block (struct function *fn, unsigned int index)
 /* Read the CFG for function FN from input block IB.  */
 
 static void
-input_cfg (struct lto_input_block *ib, struct function *fn,
+input_cfg (struct lto_input_block *ib, struct data_in *data_in,
+          struct function *fn,
           int count_materialization_scale)
 {
   unsigned int bb_count;
@@ -714,6 +715,11 @@ input_cfg (struct lto_input_block *ib, struct function *fn,
          loop->nb_iterations_estimate.high = streamer_read_hwi (ib);
        }
 
+      /* Read OMP SIMD related info.  */
+      loop->safelen = streamer_read_hwi (ib);
+      loop->force_vect = streamer_read_hwi (ib);
+      loop->simduid = stream_read_tree (ib, data_in);
+
       place_new_loop (fn, loop);
 
       /* flow_loops_find doesn't like loops not in the tree, hook them
@@ -877,6 +883,8 @@ input_struct_function_base (struct function *fn, struct data_in *data_in,
   fn->has_nonlocal_label = bp_unpack_value (&bp, 1);
   fn->calls_alloca = bp_unpack_value (&bp, 1);
   fn->calls_setjmp = bp_unpack_value (&bp, 1);
+  fn->has_force_vect_loops = bp_unpack_value (&bp, 1);
+  fn->has_simduid_loops = bp_unpack_value (&bp, 1);
   fn->va_list_fpr_size = bp_unpack_value (&bp, 8);
   fn->va_list_gpr_size = bp_unpack_value (&bp, 8);
 
@@ -923,7 +931,7 @@ input_function (tree fn_decl, struct data_in *data_in,
   if (!node)
     node = cgraph_create_node (fn_decl);
   input_struct_function_base (fn, data_in, ib);
-  input_cfg (ib_cfg, fn, node->count_materialization_scale);
+  input_cfg (ib_cfg, data_in, fn, node->count_materialization_scale);
 
   /* Read all the SSA names.  */
   input_ssa_names (ib, data_in, fn);
index 6163d120dc8874c9cb11636e2b80b60a9a9c9e16..94dc13172a5ddb98aaa8e26040547b7fa6d0b54b 100644 (file)
@@ -1642,6 +1642,11 @@ output_cfg (struct output_block *ob, struct function *fn)
          streamer_write_uhwi (ob, loop->nb_iterations_estimate.low);
          streamer_write_hwi (ob, loop->nb_iterations_estimate.high);
        }
+
+      /* Write OMP SIMD related info.  */
+      streamer_write_hwi (ob, loop->safelen);
+      streamer_write_hwi (ob, loop->force_vect);
+      stream_write_tree (ob, loop->simduid, true);
     }
 
   ob->main_stream = tmp_stream;
@@ -1735,6 +1740,8 @@ output_struct_function_base (struct output_block *ob, struct function *fn)
   bp_pack_value (&bp, fn->has_nonlocal_label, 1);
   bp_pack_value (&bp, fn->calls_alloca, 1);
   bp_pack_value (&bp, fn->calls_setjmp, 1);
+  bp_pack_value (&bp, fn->has_force_vect_loops, 1);
+  bp_pack_value (&bp, fn->has_simduid_loops, 1);
   bp_pack_value (&bp, fn->va_list_fpr_size, 8);
   bp_pack_value (&bp, fn->va_list_gpr_size, 8);
 
index 0a6e0cdb72fe61be0d8e2f95566a3d0ef34a5313..f42ade0214539fb9346daf73d9bcf6cb9d5cf236 100644 (file)
@@ -3797,12 +3797,16 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
 
     case GIMPLE_CALL:
       {
-       tree decl = gimple_call_fndecl (stmt);
+       tree decl;
        struct cgraph_node *node = NULL;
 
        /* Do not special case builtins where we see the body.
           This just confuse inliner.  */
-       if (!decl || !(node = cgraph_get_node (decl)) || node->definition)
+       if (gimple_call_internal_p (stmt))
+         return 0;
+       else if (!(decl = gimple_call_fndecl (stmt))
+                || !(node = cgraph_get_node (decl))
+                || node->definition)
          ;
        /* For buitins that are likely expanded to nothing or
           inlined do not account operand costs.  */
@@ -4423,6 +4427,7 @@ gimple_expand_calls_inline (basic_block bb, copy_body_data *id)
       gimple stmt = gsi_stmt (gsi);
 
       if (is_gimple_call (stmt)
+         && !gimple_call_internal_p (stmt)
          && expand_call_inline (bb, stmt, id))
        return true;
     }