aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2020-02-20 18:11:32 +0100
committerTobias Burnus <tobias@codesourcery.com>2020-02-20 18:11:32 +0100
commit2c52b2884ba10b1c5050fe066bae651680c8ebae (patch)
tree4983f8105a363dc94ef9ba03fb531f3c4737ddcd
parentb82d426662469ee8b78ec7e8f74abe950485c9d5 (diff)
downloadgcc-2c52b2884ba10b1c5050fe066bae651680c8ebae.zip
gcc-2c52b2884ba10b1c5050fe066bae651680c8ebae.tar.gz
gcc-2c52b2884ba10b1c5050fe066bae651680c8ebae.tar.bz2
OpenACC's tile clause fix for implicit typing (PR93825)
2020-02-20 Tobias Burnus <tobias@codesourcery.com> PR fortran/93825 * openmp.c (resolve_oacc_loop_blocks): Move call to resolve_oacc_nested_loops from here ... (resolve_oacc_loop): ... to here. PR fortran/93825 * gfortran.dg/goacc/tile-3.f90: New.
-rw-r--r--gcc/fortran/ChangeLog25
-rw-r--r--gcc/fortran/openmp.c15
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/goacc/tile-3.f9013
4 files changed, 46 insertions, 12 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 7547dcc..6795b82 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2020-02-20 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93825
+ * openmp.c (resolve_oacc_loop_blocks): Move call to
+ resolve_oacc_nested_loops from here ...
+ (resolve_oacc_loop): ... to here.
+
2020-02-18 Mark Eggleston <markeggleston@gcc.gnu.org>
PR fortran/93714
@@ -29,15 +36,15 @@
2020-02-10 Andrew Benson <abensonca@gmail.com>
- PR fortran/83113
- * array.c: Do not attempt to set the array spec for a submodule
- function symbol (as it has already been set in the corresponding
- module procedure interface).
- * symbol.c: Do not reject duplicate POINTER, ALLOCATABLE, or
- DIMENSION attributes in declarations of a submodule function.
- * gfortran.h: Add a macro that tests for a module procedure in a
- submodule.
- * gfortran.dg/pr83113.f90: New test.
+ PR fortran/83113
+ * array.c: Do not attempt to set the array spec for a submodule
+ function symbol (as it has already been set in the corresponding
+ module procedure interface).
+ * symbol.c: Do not reject duplicate POINTER, ALLOCATABLE, or
+ DIMENSION attributes in declarations of a submodule function.
+ * gfortran.h: Add a macro that tests for a module procedure in a
+ submodule.
+ * gfortran.dg/pr83113.f90: New test.
2020-02-03 Julian Brown <julian@codesourcery.com>
Tobias Burnus <tobias@codesourcery.com>
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index b885e86..35f6b2f 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -6192,10 +6192,8 @@ resolve_oacc_loop_blocks (gfc_code *code)
if (code->ext.omp_clauses->tile_list)
{
gfc_expr_list *el;
- int num = 0;
for (el = code->ext.omp_clauses->tile_list; el; el = el->next)
{
- num++;
if (el->expr == NULL)
{
/* NULL expressions are used to represent '*' arguments.
@@ -6213,7 +6211,6 @@ resolve_oacc_loop_blocks (gfc_code *code)
&code->loc);
}
}
- resolve_oacc_nested_loops (code, code->block->next, num, "tiled");
}
}
@@ -6266,6 +6263,18 @@ resolve_oacc_loop (gfc_code *code)
do_code = code->block->next;
collapse = code->ext.omp_clauses->collapse;
+ /* Both collapsed and tiled loops are lowered the same way, but are not
+ compatible. In gfc_trans_omp_do, the tile is prioritized. */
+ if (code->ext.omp_clauses->tile_list)
+ {
+ int num = 0;
+ gfc_expr_list *el;
+ for (el = code->ext.omp_clauses->tile_list; el; el = el->next)
+ ++num;
+ resolve_oacc_nested_loops (code, code->block->next, num, "tiled");
+ return;
+ }
+
if (collapse <= 0)
collapse = 1;
resolve_oacc_nested_loops (code, do_code, collapse, "collapsed");
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a54505e..89acd3f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-20 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93825
+ * gfortran.dg/goacc/tile-3.f90: New.
+
2020-02-19 Marek Polacek <polacek@redhat.com>
PR c++/93169 - wrong-code with a non-constexpr constructor.
diff --git a/gcc/testsuite/gfortran.dg/goacc/tile-3.f90 b/gcc/testsuite/gfortran.dg/goacc/tile-3.f90
new file mode 100644
index 0000000..00b4f1d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/tile-3.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+!
+! PR fortran/93825
+!
+! Check that implicit typing works
+
+program p
+ !$acc parallel loop tile(2,2)
+ do i = 1, 8
+ do j = 1, 8
+ end do
+ end do
+end