re PR fortran/81304 (Bogus warning with -Wsurprising and -fopenmp: Type specified...
authorJakub Jelinek <jakub@gcc.gnu.org>
Fri, 24 Nov 2017 21:40:21 +0000 (22:40 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 24 Nov 2017 21:40:21 +0000 (22:40 +0100)
PR fortran/81304
* trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Set
attr.implicit_type in intrinsic_sym to avoid undesirable warning.

* testsuite/libgomp.fortran/pr81304.f90: New test.

From-SVN: r255144

gcc/fortran/ChangeLog
gcc/fortran/trans-openmp.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.fortran/pr81304.f90 [new file with mode: 0644]

index 57fe9684a4b96d5f119e224d8fb39c6be4102d8b..3278c5bfa600cdbe189787b62a04e6b670b61cc9 100644 (file)
@@ -1,4 +1,10 @@
-2017-11-23  Dirk Broemmel  <dibr-bugzilla@daswigwam.de>
+2017-11-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/81304
+       * trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Set
+       attr.implicit_type in intrinsic_sym to avoid undesirable warning.
+
+2017-11-23  Dirk Broemmel  <d.broemmel@fz-juelich.de>
            Jakub Jelinek  <jakub@redhat.com>
 
        PR fortran/81841
index 75eafe42f93659eb8ccc7323c935a993e8a35ec2..7f01f229cacf421b95295d0d527f3d847829c879 100644 (file)
@@ -1623,6 +1623,7 @@ gfc_trans_omp_array_reduction_or_udr (tree c, gfc_omp_namelist *n, locus where)
       intrinsic_sym.attr.referenced = 1;
       intrinsic_sym.attr.intrinsic = 1;
       intrinsic_sym.attr.function = 1;
+      intrinsic_sym.attr.implicit_type = 1;
       intrinsic_sym.result = &intrinsic_sym;
       intrinsic_sym.declared_at = where;
 
index 966b561c0618154b31328574092157b804dbae69..9f6b17ba4d994dcc72f5617001f580582af07536 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/81304
+       * testsuite/libgomp.fortran/pr81304.f90: New test.
+
 2017-11-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR fortran/81841
diff --git a/libgomp/testsuite/libgomp.fortran/pr81304.f90 b/libgomp/testsuite/libgomp.fortran/pr81304.f90
new file mode 100644 (file)
index 0000000..460a2a0
--- /dev/null
@@ -0,0 +1,17 @@
+! PR fortran/81304
+! { dg-do run }
+! { dg-options "-Wsurprising" }
+
+program pr81304
+   integer :: i
+   real, dimension(1:3) :: a, b, c
+   a = 128
+   b = 0
+!$omp parallel do reduction(min: a) reduction(max: b) private (c)      ! { dg-bogus "Type specified for intrinsic function" }
+   do i = 1, 16
+     c = (/ i, i - 5, i + 5 /)
+     a = min (a, c)
+     b = max (b, c)
+   end do
+   if (any (a /= (/ 1, -4, 6 /)) .or. any (b /= (/ 16, 11, 21 /))) call abort
+end