This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] More precise cfg for omp constructs
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, dnovillo at google dot com
- Date: Tue, 18 Dec 2007 18:42:51 +0100
- Subject: Re: [patch] More precise cfg for omp constructs
- References: <20070712072244.GA21251@kam.mff.cuni.cz> <20071218163039.GT20451@devserv.devel.redhat.com>
Hi,
> Assuming all these changes are ok, one fix
> would be avoid calling determine_parallel_type from within
> build_omp_regions_1, but only when it finished (i.e. from
> build_omp_regions_root/build_omp_regions), by walking the tree of
> created regions and for OMP_PARALLEL regions calling determine_parallel_type
> on them.
yes, the patch below seems to fix the problem.
Zdenek
Index: omp-low.c
===================================================================
*** omp-low.c (revision 131013)
--- omp-low.c (working copy)
*************** expand_omp (struct omp_region *region)
*** 3952,3957 ****
--- 3952,3962 ----
{
while (region)
{
+ /* First, determine whether this is a combined parallel+workshare
+ region. */
+ if (region->type == OMP_PARALLEL)
+ determine_parallel_type (region);
+
if (region->inner)
expand_omp (region->inner);
*************** build_omp_regions_1 (basic_block bb, str
*** 4028,4038 ****
region = parent;
region->exit = bb;
parent = parent->outer;
-
- /* If REGION is a parallel region, determine whether it is
- a combined parallel+workshare region. */
- if (region->type == OMP_PARALLEL)
- determine_parallel_type (region);
}
else if (code == OMP_ATOMIC_STORE)
{
--- 4033,4038 ----