diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-13 06:59:56 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-13 06:59:56 +0000 |
commit | 501bdd19602fbf922920551646c1e974a29f3dc1 (patch) | |
tree | b123c5327b8752f626c90a170c875178af34b826 /gcc/omp-low.c | |
parent | 09276310eee7ca1b0205abdb47fc612bec7ba51d (diff) | |
download | gcc-501bdd19602fbf922920551646c1e974a29f3dc1.tar.gz |
PR debug/44901
* vec.h (VEC_block_remove): Fix comment.
* tree-ssa-live.c (remove_unused_locals): Don't use
VEC_unordered_remove on local_decls, instead replace a single
vector element in each iteration if at least one element had
to be removed and VEC_truncate at the end.
* omp-low.c (expand_omp_taskreg): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162126 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index f289159e2e6..872d567fe4b 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -3378,7 +3378,7 @@ expand_omp_taskreg (struct omp_region *region) } else { - unsigned ix; + unsigned srcidx, dstidx, num; /* If the parallel region needs data sent from the parent function, then the very first statement (except possible @@ -3515,11 +3515,18 @@ expand_omp_taskreg (struct omp_region *region) single_succ_edge (new_bb)->flags = EDGE_FALLTHRU; /* Remove non-local VAR_DECLs from child_cfun->local_decls list. */ - for (ix = 0; VEC_iterate (tree, child_cfun->local_decls, ix, t); ) - if (DECL_CONTEXT (t) != cfun->decl) - ix++; - else - VEC_unordered_remove (tree, child_cfun->local_decls, ix); + num = VEC_length (tree, child_cfun->local_decls); + for (srcidx = 0, dstidx = 0; srcidx < num; srcidx++) + { + t = VEC_index (tree, child_cfun->local_decls, srcidx); + if (DECL_CONTEXT (t) == cfun->decl) + continue; + if (srcidx != dstidx) + VEC_replace (tree, child_cfun->local_decls, dstidx, t); + dstidx++; + } + if (dstidx != num) + VEC_truncate (tree, child_cfun->local_decls, dstidx); /* Inform the callgraph about the new function. */ DECL_STRUCT_FUNCTION (child_fn)->curr_properties |