Missed a bit in tree-flow.h.. I mistakenly assumed omp_region belonged there :-P

Anyway by moving struct omp_region into omp_low.h, along with the prototypes from tree-flow.h, gimple.h and tree.h. Everything works great with just a few files actually requiring omp-low.h.

AS an extra bonus, omp-low.c was *exporting* "struct omp_region *root_omp_region". tree-cfg.c was checking it for non-null and calling free_omp_regions(). Well, free_omp_regions works just fine will a NULL root_omp_region (basically does nothing and returns), so exporting it just for that one check seems nonsensical. Its now static.

Bootstraps (will really-all languages) on x86_64-unknown-linux-gnu with no new regressions. also stage 1 cross builds on rs6000 and mips. No more of that crap :-)

OK?

Andrew





	* tree-flow.h (struct omp_region): Move to omp-low.h
	* gimple.h: Move prototype to omp-low.h.
	* tree.h: Move prototype to omp-low.h.
	* omp-low.h: New File. Relocate struct and prototypes here.
	* omp-low.c (root_omp_region): Make static.
	* gimplify.c: Include omp-low.h.
	* tree-cfg.c: Include omp-low.h.
	(make_edges): Don't check root_omp_region.
	* tree-parloops.c: Include omp-low.h.

	fortran
	* trans-openmp.c: Include omp-low.h.

Index: tree-flow.h
===================================================================
*** tree-flow.h	(revision 203379)
--- tree-flow.h	(working copy)
*************** along with GCC; see the file COPYING3.
*** 41,91 ****
  			      OpenMP Region Tree
  ---------------------------------------------------------------------------*/
  
- /* Parallel region information.  Every parallel and workshare
-    directive is enclosed between two markers, the OMP_* directive
-    and a corresponding OMP_RETURN statement.  */
- 
- struct omp_region
- {
-   /* The enclosing region.  */
-   struct omp_region *outer;
- 
-   /* First child region.  */
-   struct omp_region *inner;
- 
-   /* Next peer region.  */
-   struct omp_region *next;
- 
-   /* Block containing the omp directive as its last stmt.  */
-   basic_block entry;
- 
-   /* Block containing the OMP_RETURN as its last stmt.  */
-   basic_block exit;
- 
-   /* Block containing the OMP_CONTINUE as its last stmt.  */
-   basic_block cont;
- 
-   /* If this is a combined parallel+workshare region, this is a list
-      of additional arguments needed by the combined parallel+workshare
-      library call.  */
-   vec<tree, va_gc> *ws_args;
- 
-   /* The code for the omp directive of this region.  */
-   enum gimple_code type;
- 
-   /* Schedule kind, only used for OMP_FOR type regions.  */
-   enum omp_clause_schedule_kind sched_kind;
- 
-   /* True if this is a combined parallel+workshare region.  */
-   bool is_combined_parallel;
- };
- 
- extern struct omp_region *root_omp_region;
- extern struct omp_region *new_omp_region (basic_block, enum gimple_code,
- 					  struct omp_region *);
- extern void free_omp_regions (void);
- void omp_expand_local (basic_block);
- tree copy_var_decl (tree, tree, tree);
  
  /* Location to track pending stmt for edge insertion.  */
  #define PENDING_STMT(e)	((e)->insns.g)
--- 41,46 ----
Index: gimple.h
===================================================================
*** gimple.h	(revision 203379)
--- gimple.h	(working copy)
*************** extern void dump_decl_set (FILE *, bitma
*** 1079,1086 ****
  extern bool gimple_can_coalesce_p (tree, tree);
  extern bool nonfreeing_call_p (gimple);
  
- /* In omp-low.c.  */
- extern tree omp_reduction_init (tree, tree);
  
  /* In trans-mem.c.  */
  extern void diagnose_tm_safe_errors (tree);
--- 1079,1084 ----
Index: tree.h
===================================================================
*** tree.h	(revision 203379)
--- tree.h	(working copy)
*************** extern tree build_translation_unit_decl
*** 3488,3494 ****
  extern tree build_block (tree, tree, tree, tree);
  extern tree build_empty_stmt (location_t);
  extern tree build_omp_clause (location_t, enum omp_clause_code);
- extern tree find_omp_clause (tree, enum omp_clause_code);
  
  extern tree build_vl_exp_stat (enum tree_code, int MEM_STAT_DECL);
  #define build_vl_exp(c, n) build_vl_exp_stat (c, n MEM_STAT_INFO)
--- 3488,3493 ----
Index: omp-low.h
===================================================================
*** omp-low.h	(revision 0)
--- omp-low.h	(working copy)
***************
*** 0 ****
--- 1,71 ----
+ /* Header file for openMP lowering directives.
+    Copyright (C) 2013 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+ 
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+  for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #ifndef GCC_OMP_LOW__H
+ #define GCC_OMP_LOW__H
+ 
+ /* Parallel region information.  Every parallel and workshare
+    directive is enclosed between two markers, the OMP_* directive
+    and a corresponding OMP_RETURN statement.  */
+ 
+ struct omp_region
+ {
+   /* The enclosing region.  */
+   struct omp_region *outer;
+ 
+   /* First child region.  */
+   struct omp_region *inner;
+ 
+   /* Next peer region.  */
+   struct omp_region *next;
+ 
+   /* Block containing the omp directive as its last stmt.  */
+   basic_block entry;
+ 
+   /* Block containing the OMP_RETURN as its last stmt.  */
+   basic_block exit;
+ 
+   /* Block containing the OMP_CONTINUE as its last stmt.  */
+   basic_block cont;
+ 
+   /* If this is a combined parallel+workshare region, this is a list
+      of additional arguments needed by the combined parallel+workshare
+      library call.  */
+   vec<tree, va_gc> *ws_args;
+ 
+   /* The code for the omp directive of this region.  */
+   enum gimple_code type;
+ 
+   /* Schedule kind, only used for OMP_FOR type regions.  */
+   enum omp_clause_schedule_kind sched_kind;
+ 
+   /* True if this is a combined parallel+workshare region.  */
+   bool is_combined_parallel;
+ };
+ 
+ extern tree find_omp_clause (tree, enum omp_clause_code);
+ void omp_expand_local (basic_block);
+ extern struct omp_region *new_omp_region (basic_block, enum gimple_code,
+ 					  struct omp_region *);
+ extern void free_omp_regions (void);
+ extern tree omp_reduction_init (tree, tree);
+ 
+ tree copy_var_decl (tree, tree, tree);
+ 
+ #endif /* GCC_OMP_LOW__H */
Index: omp-low.c
===================================================================
*** omp-low.c	(revision 203379)
--- omp-low.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 43,48 ****
--- 43,49 ----
  #include "optabs.h"
  #include "cfgloop.h"
  #include "target.h"
+ #include "omp-low.h"
  
  
  /* Lowering of OpenMP parallel and workshare constructs proceeds in two
*************** struct omp_for_data
*** 127,133 ****
  
  static splay_tree all_contexts;
  static int taskreg_nesting_level;
! struct omp_region *root_omp_region;
  static bitmap task_shared_vars;
  
  static void scan_omp (gimple_seq *, omp_context *);
--- 128,134 ----
  
  static splay_tree all_contexts;
  static int taskreg_nesting_level;
! static struct omp_region *root_omp_region;
  static bitmap task_shared_vars;
  
  static void scan_omp (gimple_seq *, omp_context *);
Index: gimplify.c
===================================================================
*** gimplify.c	(revision 203379)
--- gimplify.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 42,47 ****
--- 42,48 ----
  #include "pointer-set.h"
  #include "splay-tree.h"
  #include "vec.h"
+ #include "omp-low.h"
  
  #include "langhooks-def.h"	/* FIXME: for lhd_set_decl_assembler_name */
  #include "tree-pass.h"		/* FIXME: only for PROP_gimple_any */
Index: tree-cfg.c
===================================================================
*** tree-cfg.c	(revision 203379)
--- tree-cfg.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 42,47 ****
--- 42,48 ----
  #include "tree-inline.h"
  #include "target.h"
  #include "tree-ssa-live.h"
+ #include "omp-low.h"
  
  /* This file contains functions for building the Control Flow Graph (CFG)
     for a function tree.  */
*************** make_edges (void)
*** 712,719 ****
  	make_edge (bb, bb->next_bb, EDGE_FALLTHRU);
      }
  
!   if (root_omp_region)
!     free_omp_regions ();
  
    /* Fold COND_EXPR_COND of each COND_EXPR.  */
    fold_cond_expr_cond ();
--- 713,719 ----
  	make_edge (bb, bb->next_bb, EDGE_FALLTHRU);
      }
  
!   free_omp_regions ();
  
    /* Fold COND_EXPR_COND of each COND_EXPR.  */
    fold_cond_expr_cond ();
Index: tree-parloops.c
===================================================================
*** tree-parloops.c	(revision 203379)
--- tree-parloops.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 32,37 ****
--- 32,38 ----
  #include "tree-vectorizer.h"
  #include "tree-hasher.h"
  #include "tree-parloops.h"
+ #include "omp-low.h"
  
  /* This pass tries to distribute iterations of loops into several threads.
     The implementation is straightforward -- for each loop we test whether its
Index: fortran/trans-openmp.c
===================================================================
*** fortran/trans-openmp.c	(revision 203379)
--- fortran/trans-openmp.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 32,37 ****
--- 32,38 ----
  #include "trans-array.h"
  #include "trans-const.h"
  #include "arith.h"
+ #include "omp-low.h"
  
  int ompws_flags;
  

Reply via email to