OSDN Git Service

2009-09-14 Sebastian Pop <sebastian.pop@amd.com>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / openmp.c
index 0e9dda8..d60121c 100644 (file)
@@ -396,12 +396,13 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, int mask)
              const char *p = gfc_extract_int (cexpr, &collapse);
              if (p)
                {
-                 gfc_error (p);
+                 gfc_error_now (p);
                  collapse = 1;
                }
              else if (collapse <= 0)
                {
-                 gfc_error ("COLLAPSE clause argument not constant positive integer at %C");
+                 gfc_error_now ("COLLAPSE clause argument not"
+                                " constant positive integer at %C");
                  collapse = 1;
                }
              c->collapse = collapse;
@@ -872,7 +873,7 @@ resolve_omp_clauses (gfc_code *code)
                if (!n->sym->attr.threadprivate)
                  gfc_error ("Non-THREADPRIVATE object '%s' in COPYIN clause"
                             " at %L", n->sym->name, &code->loc);
-               if (n->sym->ts.type == BT_DERIVED && n->sym->ts.derived->attr.alloc_comp)
+               if (n->sym->ts.type == BT_DERIVED && n->sym->ts.u.derived->attr.alloc_comp)
                  gfc_error ("COPYIN clause object '%s' at %L has ALLOCATABLE components",
                             n->sym->name, &code->loc);
              }
@@ -883,7 +884,7 @@ resolve_omp_clauses (gfc_code *code)
                if (n->sym->as && n->sym->as->type == AS_ASSUMED_SIZE)
                  gfc_error ("Assumed size array '%s' in COPYPRIVATE clause "
                             "at %L", n->sym->name, &code->loc);
-               if (n->sym->ts.type == BT_DERIVED && n->sym->ts.derived->attr.alloc_comp)
+               if (n->sym->ts.type == BT_DERIVED && n->sym->ts.u.derived->attr.alloc_comp)
                  gfc_error ("COPYPRIVATE clause object '%s' at %L has ALLOCATABLE components",
                             n->sym->name, &code->loc);
              }
@@ -915,7 +916,7 @@ resolve_omp_clauses (gfc_code *code)
                                 n->sym->name, name, &code->loc);
                    /* Variables in REDUCTION-clauses must be of intrinsic type (flagged below).  */
                    if ((list < OMP_LIST_REDUCTION_FIRST || list > OMP_LIST_REDUCTION_LAST) &&
-                       n->sym->ts.type == BT_DERIVED && n->sym->ts.derived->attr.alloc_comp)
+                       n->sym->ts.type == BT_DERIVED && n->sym->ts.u.derived->attr.alloc_comp)
                      gfc_error ("%s clause object '%s' has ALLOCATABLE components at %L",
                                 name, n->sym->name, &code->loc);
                    if (n->sym->attr.cray_pointer)
@@ -1503,6 +1504,9 @@ resolve_omp_do (gfc_code *code)
 void
 gfc_resolve_omp_directive (gfc_code *code, gfc_namespace *ns ATTRIBUTE_UNUSED)
 {
+  if (code->op != EXEC_OMP_ATOMIC)
+    gfc_maybe_initialize_eh ();
+
   switch (code->op)
     {
     case EXEC_OMP_DO: