aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-09-13 14:42:04 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2013-09-13 14:42:04 +0200
commitf3b331d117a3dd2e406d9746178f8c5644156fb0 (patch)
tree88eeb2b870640142e2694a00e1bb45b6744ce437 /gcc/tree-cfg.c
parentae6d090748df54cb09a9bd7dc5d4d9b4668296f9 (diff)
downloadgcc-f3b331d117a3dd2e406d9746178f8c5644156fb0.zip
gcc-f3b331d117a3dd2e406d9746178f8c5644156fb0.tar.gz
gcc-f3b331d117a3dd2e406d9746178f8c5644156fb0.tar.bz2
re PR libgomp/58392 (internal compiler error: in expand_GOMP_SIMD_VF, at internal-fn.c (omp simd inside omp parallel))
PR tree-optimization/58392 * tree-cfg.c (move_sese_region_to_fn): Rename loop variable to avoid shadowing of outer loop variable. If saved_cfun->has_simduid_loops or saved_cfun->has_force_vect_loops, replace_by_duplicate_decl simduid of loops that have it set and set dest_cfun->has_simduid_loops and/or dest_cfun->has_force_vect_loops. * omp-low.c (build_outer_var_ref): Call maybe_lookup_decl_in_outer_ctx instead of maybe_lookup_decl. * tree-inline.c (copy_loops): Change blocks_to_copy argument to id. Use id->blocks_to_copy instead of blocks_to_copy. Adjust recursive call. Copy over force_vect and copy and remap simduid. Set cfun->has_simduid_loops and/or cfun->has_force_vect_loops. (copy_cfg_body): Remove blocks_to_copy argument. Use id->blocks_to_copy instead of blocks_to_copy. Adjust copy_loops caller. Don't set cfun->has_simduid_loops and/or cfun->has_force_vect_loops here. (copy_body): Remove blocks_to_copy argument. Adjust copy_cfg_body caller. (expand_call_inline, tree_function_versioning): Adjust copy_body callers. From-SVN: r202564
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 42f42a6..70930a35 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -6765,10 +6765,10 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
if (bb->loop_father->header == bb
&& loop_outer (bb->loop_father) == loop)
{
- struct loop *loop = bb->loop_father;
+ struct loop *this_loop = bb->loop_father;
flow_loop_tree_node_remove (bb->loop_father);
- flow_loop_tree_node_add (get_loop (dest_cfun, 0), loop);
- fixup_loop_arrays_after_move (saved_cfun, cfun, loop);
+ flow_loop_tree_node_add (get_loop (dest_cfun, 0), this_loop);
+ fixup_loop_arrays_after_move (saved_cfun, cfun, this_loop);
}
/* Remove loop exits from the outlined region. */
@@ -6823,6 +6823,23 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
outer; outer = loop_outer (outer))
outer->num_nodes -= bbs.length ();
+ if (saved_cfun->has_simduid_loops || saved_cfun->has_force_vect_loops)
+ {
+ struct loop *aloop;
+ for (i = 0; vec_safe_iterate (loops->larray, i, &aloop); i++)
+ if (aloop != NULL)
+ {
+ if (aloop->simduid)
+ {
+ replace_by_duplicate_decl (&aloop->simduid, d.vars_map,
+ d.to_context);
+ dest_cfun->has_simduid_loops = true;
+ }
+ if (aloop->force_vect)
+ dest_cfun->has_force_vect_loops = true;
+ }
+ }
+
/* Rewire BLOCK_SUBBLOCKS of orig_block. */
if (orig_block)
{