public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Dominique d'Humières" <dominiq@lps.ens.fr>
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: "jvdelisle@charter.net" <jvdelisle@charter.net>,
	       gfortran <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH,fortran] Handle BOZ in accordance to Fortran 2018 standard (1st batch)
Date: Mon, 22 Jul 2019 13:27:00 -0000	[thread overview]
Message-ID: <85000FF8-5C9B-4666-9047-F246412DC9F9@lps.ens.fr> (raw)

(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	other threads:[~2019-07-22 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 13:27 Dominique d'Humières [this message]
2019-07-23 21:57 ` Steve Kargl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85000FF8-5C9B-4666-9047-F246412DC9F9@lps.ens.fr \
    --to=dominiq@lps.ens.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jvdelisle@charter.net \
    --cc=sgk@troutmask.apl.washington.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).