diff options
author | Richard Henderson <rth@redhat.com> | 2006-04-13 16:44:25 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2006-04-13 16:44:25 -0700 |
commit | 777f7f9a72532980c1b5cfa05a7a1f032807f10f (patch) | |
tree | bb861aba6cb32495b9e9f3ecc9c7b1dab32bf035 /gcc/tree.h | |
parent | a239aa95dc5271ebabed7a98e026b69bc16d9b85 (diff) | |
download | gcc-777f7f9a72532980c1b5cfa05a7a1f032807f10f.zip gcc-777f7f9a72532980c1b5cfa05a7a1f032807f10f.tar.gz gcc-777f7f9a72532980c1b5cfa05a7a1f032807f10f.tar.bz2 |
re PR libgomp/26651 ([gomp] #omp for ordered leaks memory)
PR 26651
* gimple-low.c (lower_omp_directive): Remove dead code.
(lower_stmt): Do nothing except for openmp, except for OMP_PARALLEL.
* gimplify.c (gimplify_expr): Update for OMP_RETURN, OMP_CONTINUE.
* omp-low.c (struct omp_region): Move to tree-flow.h.
(root_omp_region): Export.
(omp_regions, lookup_omp_region): Remove.
(determine_parallel_type): Update for struct omp_region changes.
(dump_omp_region): Dump regions with block numbers.
(new_omp_region): Take type and block instead of stmt; malloc
instead of ggc.
(free_omp_region_1, free_omp_regions): New.
(expand_parallel_call): Take entry_stmt as argument; update for
changes to omp_region.
(remove_exit_barrier): Rewrite to update OMP_RETURN_NOWAIT.
(remove_exit_barriers): New.
(expand_omp_parallel): Update for struct omp_region changes.
(expand_omp_synch): Likewise.
(expand_omp): Likewise.
(expand_omp_for_static_nochunk): Likewise; update for OMP_CONTINUE.
(expand_omp_for_static_chunk): Likewise.
(expand_omp_for): Likewise.
(expand_omp_for_generic): Likewise; emit the proper GOMP_loop_end call.
(expand_omp_sections): Similarly, with GOMP_sections_end.
(expand_omp_single): New.
(build_omp_regions_1): Update for OMP_CONTINUE.
(execute_expand_omp): Call remove_exit_barriers, free_omp_regions.
(lower_omp_sections): Expand with OMP_CONTINUE, do not collect
OMP_SECTIONS_SECTIONS.
(lower_omp_single_simple): Don't emit barrier here.
(lower_omp_single_copy): Likewise.
(lower_omp_single): Fix bindings, and lower to straightline now.
(lower_omp_master, lower_omp_ordered): Likewise.
(lower_omp_critical): Likewise.
(lower_omp_for): Likewise. Emit OMP_CONTINUE.
* tree-cfg.c (make_edges): Collect an omp_region tree, use it for
omp edges, free it afterward.
(make_omp_sections_edges): Remove.
(is_ctrl_altering_stmt): Don't bother checking flag_openmp.
(move_stmt_r): Handle OMP_CONTINUE.
* tree-flow.h (struct omp_region): Move from omp-low.c. Switch
statement pointers to basic blocks. Add type member.
(root_omp_region, new_omp_region, free_omp_regions): Declare.
* tree-gimple.c (is_gimple_stmt): Handle OMP_RETURN, OMP_CONTINUE.
* tree-inline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree.def (OMP_SECTIONS): Remove OMP_SECTIONS_SECTIONS operand.
(OMP_RETURN): Rename from OMP_RETURN_EXPR.
(OMP_CONTINUE): New.
* tree.h (OMP_DIRECTIVE_P): Add OMP_CONTINUE.
(OMP_SECTIONS_SECTIONS): Remove.
(OMP_SECTION_LAST): New.
(OMP_RETURN_NOWAIT): New.
fortran/
* trans-openmp.c (gfc_trans_omp_sections): Adjust for changed
number of operands to OMP_SECTIONS.
testsuite/
* g++.dg/gomp/block-0.C: Update expected matches.
From-SVN: r112935
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -170,14 +170,15 @@ extern const enum tree_code_class tree_code_type[]; #define OMP_DIRECTIVE_P(NODE) \ (TREE_CODE (NODE) == OMP_PARALLEL \ - || TREE_CODE (NODE) == OMP_SECTIONS \ - || TREE_CODE (NODE) == OMP_SECTION \ || TREE_CODE (NODE) == OMP_FOR \ - || TREE_CODE (NODE) == OMP_RETURN_EXPR \ + || TREE_CODE (NODE) == OMP_SECTIONS \ || TREE_CODE (NODE) == OMP_SINGLE \ + || TREE_CODE (NODE) == OMP_SECTION \ || TREE_CODE (NODE) == OMP_MASTER \ || TREE_CODE (NODE) == OMP_ORDERED \ - || TREE_CODE (NODE) == OMP_CRITICAL) + || TREE_CODE (NODE) == OMP_CRITICAL \ + || TREE_CODE (NODE) == OMP_RETURN \ + || TREE_CODE (NODE) == OMP_CONTINUE) /* Number of argument-words in each kind of tree-node. */ @@ -437,6 +438,10 @@ struct tree_common GTY(()) CALL_EXPR DECL_BY_REFERENCE in PARM_DECL, RESULT_DECL + OMP_RETURN_NOWAIT in + OMP_RETURN + OMP_SECTION_LAST in + OMP_SECTION protected_flag: @@ -1546,7 +1551,6 @@ struct tree_constructor GTY(()) #define OMP_SECTIONS_BODY(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0) #define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1) -#define OMP_SECTIONS_SECTIONS(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 2) #define OMP_SECTION_BODY(NODE) TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0) @@ -1566,6 +1570,18 @@ struct tree_constructor GTY(()) OMP_CLAUSE_PRIVATE, \ OMP_CLAUSE_COPYPRIVATE), 0) +/* True on an OMP_SECTION statement that was the last lexical member. + This status is meaningful in the implementation of lastprivate. */ +#define OMP_SECTION_LAST(NODE) \ + TREE_PRIVATE (OMP_SECTION_CHECK (NODE)) + +/* True on an OMP_RETURN statement if the return does not require a + thread synchronization via some sort of barrier. The exact barrier + that would otherwise be emitted is dependent on the OMP statement + with which this return is associated. */ +#define OMP_RETURN_NOWAIT(NODE) \ + TREE_PRIVATE (OMP_RETURN_CHECK (NODE)) + /* True on a PRIVATE clause if its decl is kept around for debugging information only and its DECL_VALUE_EXPR is supposed to point to what it has been remapped to. */ |