aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-04-26 12:56:36 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-04-26 12:56:36 +0000
commitd7ed20db763473e20d1186e5e138ae00e5afc764 (patch)
tree59f2be7bd6aa35b6e02ed5b1144cf5da176a6d03 /gcc/omp-low.c
parent6e03fa931c3264b82681e0f7894e161e148dbfc5 (diff)
downloadgcc-d7ed20db763473e20d1186e5e138ae00e5afc764.zip
gcc-d7ed20db763473e20d1186e5e138ae00e5afc764.tar.gz
gcc-d7ed20db763473e20d1186e5e138ae00e5afc764.tar.bz2
omp-low.c (finalize_task_copyfn): Do not drop PROP_loops.
2013-04-26 Richard Biener <rguenther@suse.de> * omp-low.c (finalize_task_copyfn): Do not drop PROP_loops. (expand_omp_taskreg): Likewise. Mark loops for fixup. * tree-cfg.c (move_block_to_fn): Remap loop fathers. (fixup_loop_arrays_after_move): New function. (move_sese_region_to_fn): Properly outline the loop tree parts of the SESE region. From-SVN: r198338
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index eaeeaa5..81ae5b4 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1258,10 +1258,7 @@ finalize_task_copyfn (gimple task_stmt)
return;
child_cfun = DECL_STRUCT_FUNCTION (child_fn);
-
- /* Inform the callgraph about the new function. */
- DECL_STRUCT_FUNCTION (child_fn)->curr_properties
- = cfun->curr_properties & ~PROP_loops;
+ DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties;
push_cfun (child_cfun);
bind = gimplify_body (child_fn, false);
@@ -1276,6 +1273,7 @@ finalize_task_copyfn (gimple task_stmt)
gimple_set_body (child_fn, seq);
pop_cfun ();
+ /* Inform the callgraph about the new function. */
cgraph_add_new_function (child_fn, false);
}
@@ -3573,6 +3571,11 @@ expand_omp_taskreg (struct omp_region *region)
new_bb = move_sese_region_to_fn (child_cfun, entry_bb, exit_bb, block);
if (exit_bb)
single_succ_edge (new_bb)->flags = EDGE_FALLTHRU;
+ /* ??? As the OMP expansion process does not update the loop
+ tree of the original function before outlining the region to
+ the new child function we need to discover loops in the child.
+ Arrange for that. */
+ child_cfun->x_current_loops->state |= LOOPS_NEED_FIXUP;
/* Remove non-local VAR_DECLs from child_cfun->local_decls list. */
num = vec_safe_length (child_cfun->local_decls);
@@ -3589,8 +3592,7 @@ expand_omp_taskreg (struct omp_region *region)
vec_safe_truncate (child_cfun->local_decls, dstidx);
/* Inform the callgraph about the new function. */
- DECL_STRUCT_FUNCTION (child_fn)->curr_properties
- = cfun->curr_properties & ~PROP_loops;
+ DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties;
cgraph_add_new_function (child_fn, true);
/* Fix the callgraph edges for child_cfun. Those for cfun will be