Commit 5d62bfc3 by Thomas Schwinge

Correct the reported line number in Fortran combined OpenACC directives

	gcc/fortran/
	* trans-openmp.c (gfc_trans_oacc_combined_directive): Set the
	location of combined acc loops.
	gcc/testsuite/
	* gfortran.dg/goacc/combined-directives-3.f90: New file.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>

From-SVN: r266924
parent 65b5f496
2018-12-09 Cesar Philippidis <cesar@codesourcery.com>
* trans-openmp.c (gfc_trans_oacc_combined_directive): Set the
location of combined acc loops.
2018-12-09 Thomas Schwinge <thomas@codesourcery.com> 2018-12-09 Thomas Schwinge <thomas@codesourcery.com>
* openmp.c (resolve_oacc_loop_blocks): Remove checking of OpenACC * openmp.c (resolve_oacc_loop_blocks): Remove checking of OpenACC
......
...@@ -3878,6 +3878,7 @@ gfc_trans_oacc_combined_directive (gfc_code *code) ...@@ -3878,6 +3878,7 @@ gfc_trans_oacc_combined_directive (gfc_code *code)
gfc_omp_clauses construct_clauses, loop_clauses; gfc_omp_clauses construct_clauses, loop_clauses;
tree stmt, oacc_clauses = NULL_TREE; tree stmt, oacc_clauses = NULL_TREE;
enum tree_code construct_code; enum tree_code construct_code;
location_t loc = input_location;
switch (code->op) switch (code->op)
{ {
...@@ -3939,12 +3940,12 @@ gfc_trans_oacc_combined_directive (gfc_code *code) ...@@ -3939,12 +3940,12 @@ gfc_trans_oacc_combined_directive (gfc_code *code)
else else
pushlevel (); pushlevel ();
stmt = gfc_trans_omp_do (code, EXEC_OACC_LOOP, pblock, &loop_clauses, NULL); stmt = gfc_trans_omp_do (code, EXEC_OACC_LOOP, pblock, &loop_clauses, NULL);
protected_set_expr_location (stmt, loc);
if (TREE_CODE (stmt) != BIND_EXPR) if (TREE_CODE (stmt) != BIND_EXPR)
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0)); stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
else else
poplevel (0, 0); poplevel (0, 0);
stmt = build2_loc (input_location, construct_code, void_type_node, stmt, stmt = build2_loc (loc, construct_code, void_type_node, stmt, oacc_clauses);
oacc_clauses);
gfc_add_expr_to_block (&block, stmt); gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block); return gfc_finish_block (&block);
} }
......
2018-12-09 Thomas Schwinge <thomas@codesourcery.com>
* gfortran.dg/goacc/combined-directives-3.f90: New file.
2018-12-09 Cesar Philippidis <cesar@codesourcery.com> 2018-12-09 Cesar Philippidis <cesar@codesourcery.com>
* c-c++-common/goacc/combined-directives-3.c: New test. * c-c++-common/goacc/combined-directives-3.c: New test.
......
/* Verify the accuracy of the line number associated with combined /* Verify the accuracy of the line number associated with combined
constructs. */ constructs. */
/* See also "../../gfortran.dg/goacc/combined-directives-3.f90". */
int int
main () main ()
......
! Verify the accuracy of the line number associated with combined constructs.
! See "../../c-c++-common/goacc/combined-directives-3.c".
subroutine test
implicit none
integer x, y, z
!$acc parallel loop seq auto ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
do x = 0, 10
!$acc loop
do y = 0, 10
end do
end do
!$acc end parallel loop
!$acc parallel loop gang auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
do x = 0, 10
!$acc loop worker auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
do y = 0, 10
!$acc loop vector
do z = 0, 10
end do
end do
end do
!$acc end parallel loop
end subroutine test
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