diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-07-10 09:27:37 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-07-10 09:27:37 +0200 |
commit | 100291de48d70d56f8ec31e8ba8d9edd1ee95b45 (patch) | |
tree | 7af00363ff567326a2db773e9c4dfc629fd0d312 /gcc/fortran/module.c | |
parent | 0b27c3eda934bfc946d64fb72203001c5bee46a1 (diff) | |
download | gcc-100291de48d70d56f8ec31e8ba8d9edd1ee95b45.zip gcc-100291de48d70d56f8ec31e8ba8d9edd1ee95b45.tar.gz gcc-100291de48d70d56f8ec31e8ba8d9edd1ee95b45.tar.bz2 |
re PR fortran/86421 (OpenMP declare simd linear ref in module causes gfortran to bail out)
PR fortran/86421
* module.c (omp_declare_simd_clauses): Add LINEAR with _REF, _VAL and
_UVAL suffixes.
(mio_omp_declare_simd): Save and restore ref, val and uval modifiers
on linear clauses. Initialize n->where to gfc_current_locus.
* gfortran.dg/vect/pr86421.f90: New test.
From-SVN: r262535
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r-- | gcc/fortran/module.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index c833e67..a313c3b 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -4098,6 +4098,9 @@ static const mstring omp_declare_simd_clauses[] = minit ("UNIFORM", 3), minit ("LINEAR", 4), minit ("ALIGNED", 5), + minit ("LINEAR_REF", 33), + minit ("LINEAR_VAL", 34), + minit ("LINEAR_UVAL", 35), minit (NULL, -1) }; @@ -4140,7 +4143,10 @@ mio_omp_declare_simd (gfc_namespace *ns, gfc_omp_declare_simd **odsp) } for (n = ods->clauses->lists[OMP_LIST_LINEAR]; n; n = n->next) { - mio_name (4, omp_declare_simd_clauses); + if (n->u.linear_op == OMP_LINEAR_DEFAULT) + mio_name (4, omp_declare_simd_clauses); + else + mio_name (32 + n->u.linear_op, omp_declare_simd_clauses); mio_symbol_ref (&n->sym); mio_expr (&n->expr); } @@ -4181,11 +4187,20 @@ mio_omp_declare_simd (gfc_namespace *ns, gfc_omp_declare_simd **odsp) case 4: case 5: *ptrs[t - 3] = n = gfc_get_omp_namelist (); + finish_namelist: + n->where = gfc_current_locus; ptrs[t - 3] = &n->next; mio_symbol_ref (&n->sym); if (t != 3) mio_expr (&n->expr); break; + case 33: + case 34: + case 35: + *ptrs[1] = n = gfc_get_omp_namelist (); + n->u.linear_op = (enum gfc_omp_linear_op) (t - 32); + t = 4; + goto finish_namelist; } } } |