This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] More precise cfg for omp constructs


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 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]