Re: [PATCH,fortran] Handle BOZ in accordance to Fortran 2018 standard (1st batch)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH,fortran] Handle BOZ in accordance to Fortran 2018 standard (1st batch)

Dominique d'Humières-2
(A) I see the following failures

FAIL: libgomp.fortran/reduction4.f90   -O0  (test for excess errors)

FAIL: libgomp.fortran/reduction4.f90   -Os  (test for excess errors)
FAIL: libgomp.fortran/reduction5.f90   -O0  (test for excess errors)

FAIL: libgomp.fortran/reduction5.f90   -Os  (test for excess errors)

I have silenced the failures with following patch:

--- ../_clean/libgomp/testsuite/libgomp.fortran/reduction4.f90 2018-03-25 18:07:25.000000000 +0200
+++ libgomp/testsuite/libgomp.fortran/reduction4.f90 2019-07-19 00:04:29.000000000 +0200
@@ -4,12 +4,12 @@
   integer (kind = 4) :: i, ia (6), j, ja (6), k, ka (6), ta (6), n, cnt, x
   logical :: v
 
-  i = Z'ffff0f'
-  ia = Z'f0ff0f'
-  j = Z'0f0000'
-  ja = Z'0f5a00'
-  k = Z'055aa0'
-  ka = Z'05a5a5'
+  i = int(Z'ffff0f')
+  ia = int(Z'f0ff0f')
+  j = int(Z'0f0000')
+  ja = int(Z'0f5a00')
+  k = int(Z'055aa0')
+  ka = int(Z'05a5a5')
   v = .false.
   cnt = -1
   x = not(0)
@@ -22,35 +22,35 @@
   n = omp_get_thread_num ()
   if (n .eq. 0) then
     cnt = omp_get_num_threads ()
-    i = Z'ff7fff'
-    ia(3:5) = Z'fffff1'
-    j = Z'078000'
+    i = int(Z'ff7fff')
+    ia(3:5) = int(Z'fffff1')
+    j = int(Z'078000')
     ja(1:3) = 1
-    k = Z'78'
-    ka(3:6) = Z'f0f'
+    k = int(Z'78')
+    ka(3:6) = int(Z'f0f')
   else if (n .eq. 1) then
-    i = Z'ffff77'
-    ia(2:5) = Z'ffafff'
-    j = Z'007800'
+    i = int(Z'ffff77')
+    ia(2:5) = int(Z'ffafff')
+    j = int(Z'007800')
     ja(2:5) = 8
-    k = Z'57'
-    ka(3:4) = Z'f0108'
+    k = int(Z'57')
+    ka(3:4) = int(Z'f0108')
   else
-    i = Z'777fff'
-    ia(1:2) = Z'fffff3'
-    j = Z'000780'
-    ja(5:6) = Z'f00'
-    k = Z'1000'
-    ka(6:6) = Z'777'
+    i = int(Z'777fff')
+    ia(1:2) = int(Z'fffff3')
+    j = int(Z'000780')
+    ja(5:6) = int(Z'f00')
+    k = int(Z'1000')
+    ka(6:6) = int(Z'777')
   end if
 !$omp end parallel
   if (v) STOP 1
   if (cnt .eq. 3) then
-    ta = (/Z'f0ff03', Z'f0af03', Z'f0af01', Z'f0af01', Z'f0af01', Z'f0ff0f'/)
-    if (i .ne. Z'777f07' .or. any (ia .ne. ta)) STOP 2
-    ta = (/Z'f5a01', Z'f5a09', Z'f5a09', Z'f5a08', Z'f5f08', Z'f5f00'/)
-    if (j .ne. Z'fff80' .or. any (ja .ne. ta)) STOP 3
-    ta = (/Z'5a5a5', Z'5a5a5', Z'aaba2', Z'aaba2', Z'5aaaa', Z'5addd'/)
-    if (k .ne. Z'54a8f' .or. any (ka .ne. ta)) STOP 4
+    ta = (/int(Z'f0ff03'), int(Z'f0af03'), int(Z'f0af01'), int(Z'f0af01'), int(Z'f0af01'), int(Z'f0ff0f')/)
+    if (i .ne. int(Z'777f07') .or. any (ia .ne. ta)) STOP 2
+    ta = (/int(Z'f5a01'), int(Z'f5a09'), int(Z'f5a09'), int(Z'f5a08'), int(Z'f5f08'), int(Z'f5f00')/)
+    if (j .ne. int(Z'fff80') .or. any (ja .ne. ta)) STOP 3
+    ta = (/int(Z'5a5a5'), int(Z'5a5a5'), int(Z'aaba2'), int(Z'aaba2'), int(Z'5aaaa'), int(Z'5addd')/)
+    if (k .ne. int(Z'54a8f') .or. any (ka .ne. ta)) STOP 4
   end if
 end
--- ../_clean/libgomp/testsuite/libgomp.fortran/reduction5.f90 2018-03-25 18:07:24.000000000 +0200
+++ libgomp/testsuite/libgomp.fortran/reduction5.f90 2019-07-18 23:56:59.000000000 +0200
@@ -10,7 +10,7 @@ contains
   subroutine test1
     use reduction5, bitwise_or => ior
     integer :: n
-    n = Z'f'
+    n = int(Z'f')
 !$omp parallel sections num_threads (3) reduction (bitwise_or: n)
     n = ior (n, Z'20')
 !$omp section
@@ -18,7 +18,7 @@ contains
 !$omp section
     n = bitwise_or (n, Z'2000')
 !$omp end parallel sections
-    if (n .ne. Z'243f') STOP 1
+    if (n .ne. int(Z'243f')) STOP 1
   end subroutine
   subroutine test2
     use reduction5, min => max, max => min

(B) The points mentioned in https://gcc.gnu.org/ml/fortran/2017-10/msg00037.html have been fixed,
 except the points (3) and (6) which still give an ICE. I understand that the coddles are invalid,
 but IMO they should give an error along the line

"BOZ literal at %L outside a DATA statement and outside INT/REAL/DBLE/CMPLX »

I have more comments for a second batch

Dominique
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH,fortran] Handle BOZ in accordance to Fortran 2018 standard (1st batch)

Steve Kargl
On Mon, Jul 22, 2019 at 02:33:08PM +0200, Dominique d'Humières wrote:
> (A) I see the following failures
>
> FAIL: libgomp.fortran/reduction4.f90   -O0  (test for excess errors)
> …
> FAIL: libgomp.fortran/reduction5.f90   -Os  (test for excess errors)
>

I added a fix for this to the megapatch.  It is rather slow
to test on i586-*-freebsd, so I tend to forget to test libgomp.

> (B) The points mentioned in
> https://gcc.gnu.org/ml/fortran/2017-10/msg00037.html have been fixed,
> except the points (3) and (6) which still give an ICE. I understand
> that the coddles are invalid,
>  but IMO they should give an error along the line
>
> "BOZ literal at %L outside a DATA statement and outside INT/REAL/DBLE/CMPLX »
>

I'll fix this shortly.  A BOZ is not allowed in transfer()
or storage_size().  I need to update check.c with a new
illegal_boz_arg() function and use it with the right checking
functions.

--
Steve