[patch] More precise cfg for omp constructs

Zdenek Dvorak rakdver@kam.mff.cuni.cz
Tue Dec 18 18:20:00 GMT 2007


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



More information about the Gcc-patches mailing list