Commit f7ba880b by Cesar Philippidis Committed by Cesar Philippidis

openmp.c (gfc_match_omp_clauses): Scan for clause vector_length before vector.

	gcc/fortran/
	* openmp.c (gfc_match_omp_clauses): Scan for clause vector_length
	before vector.

	gcc/testsuite/
	* gfortran.dg/goacc/vector_length.f90: New test.

From-SVN: r238375
parent b9aba0a0
2016-07-15 Cesar Philippidis <cesar@codesourcery.com>
* openmp.c (gfc_match_omp_clauses): Scan for clause vector_length
before vector.
2016-07-15 Andre Vehreschild <vehre@gcc.gnu.org> 2016-07-15 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/71807 PR fortran/71807
......
...@@ -1338,6 +1338,13 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, uint64_t mask, ...@@ -1338,6 +1338,13 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, uint64_t mask,
continue; continue;
break; break;
case 'v': case 'v':
/* VECTOR_LENGTH must be matched before VECTOR, because the latter
doesn't unconditionally match '('. */
if ((mask & OMP_CLAUSE_VECTOR_LENGTH)
&& c->vector_length_expr == NULL
&& (gfc_match ("vector_length ( %e )", &c->vector_length_expr)
== MATCH_YES))
continue;
if ((mask & OMP_CLAUSE_VECTOR) if ((mask & OMP_CLAUSE_VECTOR)
&& !c->vector && !c->vector
&& gfc_match ("vector") == MATCH_YES) && gfc_match ("vector") == MATCH_YES)
...@@ -1353,11 +1360,6 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, uint64_t mask, ...@@ -1353,11 +1360,6 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, uint64_t mask,
needs_space = true; needs_space = true;
continue; continue;
} }
if ((mask & OMP_CLAUSE_VECTOR_LENGTH)
&& c->vector_length_expr == NULL
&& (gfc_match ("vector_length ( %e )", &c->vector_length_expr)
== MATCH_YES))
continue;
break; break;
case 'w': case 'w':
if ((mask & OMP_CLAUSE_WAIT) if ((mask & OMP_CLAUSE_WAIT)
......
2016-07-15 Cesar Philippidis <cesar@codesourcery.com>
* gfortran.dg/goacc/vector_length.f90: New test.
2016-07-15 Richard Biener <rguenther@suse.de> 2016-07-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/71881 PR tree-optimization/71881
......
program t
implicit none
integer, parameter :: n = 100
integer a(n), i
!$acc parallel loop num_gangs(100) num_workers(1) vector_length(32)
do i = 1, n
a(i) = i
enddo
!$acc end parallel loop
end program t
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment