OSDN Git Service

2006-07-25 Paolo Bonzini <bonzini@gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / tree-nested.c
index 4c65a1d..591642c 100644 (file)
@@ -147,6 +147,9 @@ create_tmp_var_for (struct nesting_info *info, tree type, const char *prefix)
   DECL_CONTEXT (tmp_var) = info->context;
   TREE_CHAIN (tmp_var) = info->new_local_var_chain;
   DECL_SEEN_IN_BIND_EXPR_P (tmp_var) = 1;
+  if (TREE_CODE (type) == COMPLEX_TYPE)
+    DECL_COMPLEX_GIMPLE_REG_P (tmp_var) = 1;
+
   info->new_local_var_chain = tmp_var;
 
   return tmp_var;
@@ -1034,9 +1037,10 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
       save_suppress = info->suppress_expansion;
       if (convert_nonlocal_omp_clauses (&OMP_PARALLEL_CLAUSES (t), wi))
        {
-         tree c;
-         c = get_chain_decl (info);
-         c = build1 (OMP_CLAUSE_FIRSTPRIVATE, void_type_node, c);
+         tree c, decl;
+         decl = get_chain_decl (info);
+         c = build_omp_clause (OMP_CLAUSE_FIRSTPRIVATE);
+         OMP_CLAUSE_DECL (c) = decl;
          OMP_CLAUSE_CHAIN (c) = OMP_PARALLEL_CLAUSES (t);
          OMP_PARALLEL_CLAUSES (t) = c;
        }
@@ -1047,7 +1051,7 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
       walk_body (convert_nonlocal_reference, info, &OMP_PARALLEL_BODY (t));
 
       if (info->new_local_var_chain)
-       declare_tmp_vars (info->new_local_var_chain, OMP_PARALLEL_BODY (t));
+       declare_vars (info->new_local_var_chain, OMP_PARALLEL_BODY (t), false);
       info->new_local_var_chain = save_local_var_chain;
       info->suppress_expansion = save_suppress;
       break;
@@ -1094,7 +1098,7 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
 
   for (clause = *pclauses; clause ; clause = OMP_CLAUSE_CHAIN (clause))
     {
-      switch (TREE_CODE (clause))
+      switch (OMP_CLAUSE_CODE (clause))
        {
        case OMP_CLAUSE_PRIVATE:
        case OMP_CLAUSE_FIRSTPRIVATE:
@@ -1119,7 +1123,8 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
        case OMP_CLAUSE_NUM_THREADS:
          wi->val_only = true;
          wi->is_lhs = false;
-         convert_nonlocal_reference (&TREE_OPERAND (clause, 0), &dummy, wi);
+         convert_nonlocal_reference (&OMP_CLAUSE_OPERAND (clause, 0), &dummy,
+                                     wi);
          break;
 
        case OMP_CLAUSE_NOWAIT:
@@ -1184,6 +1189,9 @@ get_local_debug_decl (struct nesting_info *info, tree decl, tree field)
   TREE_CHAIN (new_decl) = info->debug_var_chain;
   info->debug_var_chain = new_decl;
 
+  /* Do not emit debug info twice.  */
+  DECL_IGNORED_P (decl) = 1;
+
   return new_decl;
 }
 
@@ -1317,7 +1325,8 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
        {
          tree c;
          (void) get_frame_type (info);
-         c = build1 (OMP_CLAUSE_SHARED, void_type_node, info->frame_decl);
+         c = build_omp_clause (OMP_CLAUSE_SHARED);
+         OMP_CLAUSE_DECL (c) = info->frame_decl;
          OMP_CLAUSE_CHAIN (c) = OMP_PARALLEL_CLAUSES (t);
          OMP_PARALLEL_CLAUSES (t) = c;
        }
@@ -1328,7 +1337,7 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
       walk_body (convert_local_reference, info, &OMP_PARALLEL_BODY (t));
 
       if (info->new_local_var_chain)
-       declare_tmp_vars (info->new_local_var_chain, OMP_PARALLEL_BODY (t));
+       declare_vars (info->new_local_var_chain, OMP_PARALLEL_BODY (t), false);
       info->new_local_var_chain = save_local_var_chain;
       info->suppress_expansion = save_suppress;
       break;
@@ -1375,7 +1384,7 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
 
   for (clause = *pclauses; clause ; clause = OMP_CLAUSE_CHAIN (clause))
     {
-      switch (TREE_CODE (clause))
+      switch (OMP_CLAUSE_CODE (clause))
        {
        case OMP_CLAUSE_PRIVATE:
        case OMP_CLAUSE_FIRSTPRIVATE:
@@ -1406,7 +1415,7 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
        case OMP_CLAUSE_NUM_THREADS:
          wi->val_only = true;
          wi->is_lhs = false;
-         convert_local_reference (&TREE_OPERAND (clause, 0), &dummy, wi);
+         convert_local_reference (&OMP_CLAUSE_OPERAND (clause, 0), &dummy, wi);
          break;
 
        case OMP_CLAUSE_NOWAIT:
@@ -1801,11 +1810,11 @@ finalize_nesting_tree_1 (struct nesting_info *root)
   /* Make sure all new local variables get inserted into the
      proper BIND_EXPR.  */
   if (root->new_local_var_chain)
-    declare_tmp_vars (root->new_local_var_chain,
-                     DECL_SAVED_TREE (root->context));
+    declare_vars (root->new_local_var_chain, DECL_SAVED_TREE (root->context),
+                 false);
   if (root->debug_var_chain)
-    declare_tmp_vars (root->debug_var_chain,
-                     DECL_SAVED_TREE (root->context));
+    declare_vars (root->debug_var_chain, DECL_SAVED_TREE (root->context),
+                 true);
 
   /* Dump the translated tree function.  */
   dump_function (TDI_nested, root->context);