PR fortran/62076
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Aug 2014 16:39:07 +0000 (16:39 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Aug 2014 16:39:07 +0000 (16:39 +0000)
* openmp.c (gfc_match_omp_clauses): When failed to match
operator name, defined op name or name, set buffer to
empty string.  Don't call gfc_find_omp_udr if buffer is empty
string.
(gfc_match_omp_declare_reduction): Call gfc_undo_symbols ()
before calling gfc_free_omp_udr.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213971 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/openmp.c

index 16c07bd..2c4df3a 100644 (file)
@@ -1,3 +1,13 @@
+2014-08-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/62076
+       * openmp.c (gfc_match_omp_clauses): When failed to match
+       operator name, defined op name or name, set buffer to
+       empty string.  Don't call gfc_find_omp_udr if buffer is empty
+       string.
+       (gfc_match_omp_declare_reduction): Call gfc_undo_symbols ()
+       before calling gfc_free_omp_udr.
+
 2014-08-11  Richard Biener  <rguenther@suse.de>
 
        PR fortran/61950
index 410efb1..49c3b9e 100644 (file)
@@ -464,7 +464,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, unsigned int mask,
                      || !gfc_add_intrinsic (&sym->attr, NULL)))
                rop = OMP_REDUCTION_NONE;
            }
-         gfc_omp_udr *udr = gfc_find_omp_udr (gfc_current_ns, buffer, NULL);
+         else
+           buffer[0] = '\0';
+         gfc_omp_udr *udr
+           = (buffer[0]
+              ? gfc_find_omp_udr (gfc_current_ns, buffer, NULL) : NULL);
          gfc_omp_namelist **head = NULL;
          if (rop == OMP_REDUCTION_NONE && udr)
            rop = OMP_REDUCTION_USER;
@@ -1240,6 +1244,7 @@ gfc_match_omp_declare_reduction (void)
         syntax:
          gfc_current_locus = old_loc;
          gfc_current_ns = combiner_ns->parent;
+         gfc_undo_symbols ();
          gfc_free_omp_udr (omp_udr);
          return MATCH_ERROR;
        }