diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-01-31 21:47:48 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-01-31 21:47:48 +0100 |
commit | c9243c043c06d0f8576ff4f76b92d41143d2fc2e (patch) | |
tree | 71764042a0b170dce07b1b4c90d2b1a9b9926e3b /gcc | |
parent | eddd715c77c55f342e41419410fc577f71905800 (diff) | |
download | gcc-c9243c043c06d0f8576ff4f76b92d41143d2fc2e.zip gcc-c9243c043c06d0f8576ff4f76b92d41143d2fc2e.tar.gz gcc-c9243c043c06d0f8576ff4f76b92d41143d2fc2e.tar.bz2 |
re PR fortran/84116 (ICE in gfc_match_omp_clauses, at fortran/openmp.c:1354)
PR fortran/84116
* openmp.c (gfc_match_omp_clauses): If all the linear
gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist
nor set *head = NULL. Formatting fixes.
* gfortran.dg/gomp/pr84116.f90: New test.
From-SVN: r257266
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/openmp.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/pr84116.f90 | 12 |
4 files changed, 25 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 70e1494..649ddd8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2018-01-31 Jakub Jelinek <jakub@redhat.com> + + PR fortran/84116 + * openmp.c (gfc_match_omp_clauses): If all the linear + gfc_match_omp_variable_list calls failed, don't gfc_free_omp_namelist + nor set *head = NULL. Formatting fixes. + 2018-01-31 Paul Thomas <pault@gcc.gnu.org> PR fortran/84088 diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 2f0fef1..5a14925 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -1318,23 +1318,21 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, else if (gfc_match_omp_variable_list (" val (", &c->lists[OMP_LIST_LINEAR], false, NULL, &head) - == MATCH_YES) + == MATCH_YES) linear_op = OMP_LINEAR_VAL; else if (gfc_match_omp_variable_list (" uval (", &c->lists[OMP_LIST_LINEAR], false, NULL, &head) - == MATCH_YES) + == MATCH_YES) linear_op = OMP_LINEAR_UVAL; else if (gfc_match_omp_variable_list ("", &c->lists[OMP_LIST_LINEAR], false, &end_colon, &head) - == MATCH_YES) + == MATCH_YES) linear_op = OMP_LINEAR_DEFAULT; else { - gfc_free_omp_namelist (*head); gfc_current_locus = old_loc; - *head = NULL; break; } if (linear_op != OMP_LINEAR_DEFAULT) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3f110a9..4dd7c6d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-01-31 Jakub Jelinek <jakub@redhat.com> + PR fortran/84116 + * gfortran.dg/gomp/pr84116.f90: New test. + PR c++/83993 * g++.dg/init/pr83993-2.C: New test. diff --git a/gcc/testsuite/gfortran.dg/gomp/pr84116.f90 b/gcc/testsuite/gfortran.dg/gomp/pr84116.f90 new file mode 100644 index 0000000..3a95ac5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr84116.f90 @@ -0,0 +1,12 @@ +! PR fortran/84116 +! { dg-do compile } + +program pr84116 + integer :: i, j + !$omp simd linear ((i)) ! { dg-error "Syntax error" } + do i = 1, 2 + end do + !$omp simd linear () ! { dg-error "Syntax error" } + do j = 1, 2 + end do +end |