public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/93826] [OpenMP][OpenACC] Collapsed loop – code silently ignored
       [not found] <bug-93826-4@http.gcc.gnu.org/bugzilla/>
@ 2020-05-22  8:03 ` burnus at gcc dot gnu.org
  2020-05-22  8:14 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-05-22  8:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93826

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #0)
>       do j = 1, 8
>         do k = 1, 8
>         end do
>         x = 5  ! <<< not translated but also not an error message
>       end do

Complications: BLOCK inside the j-do loop body (only one do loop, something
else; only var decl etc.); empty block(s) before/after the inner k do loop;
nonempty block.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/93826] [OpenMP][OpenACC] Collapsed loop – code silently ignored
       [not found] <bug-93826-4@http.gcc.gnu.org/bugzilla/>
  2020-05-22  8:03 ` [Bug fortran/93826] [OpenMP][OpenACC] Collapsed loop – code silently ignored burnus at gcc dot gnu.org
@ 2020-05-22  8:14 ` burnus at gcc dot gnu.org
  2020-05-22  8:37 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-05-22  8:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93826

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
OpenMP 5 has:
"If the *ordered* clause is present, all loops associated with the construct
must be perfectly nested; that is there must be no intervening code between any
two loops." (2.9.2 Worksharing-Loop Construct)

For "2.10.7.1 tile Construct", OpenMP (latest draft) has:
"All loops associated with the construct must be perfectly nested; that is
there must be no intervening code between any two loops."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/93826] [OpenMP][OpenACC] Collapsed loop – code silently ignored
       [not found] <bug-93826-4@http.gcc.gnu.org/bugzilla/>
  2020-05-22  8:03 ` [Bug fortran/93826] [OpenMP][OpenACC] Collapsed loop – code silently ignored burnus at gcc dot gnu.org
  2020-05-22  8:14 ` burnus at gcc dot gnu.org
@ 2020-05-22  8:37 ` burnus at gcc dot gnu.org
  2020-08-06  9:32 ` burnus at gcc dot gnu.org
  2020-08-06 12:53 ` dominiq at lps dot ens.fr
  4 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-05-22  8:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93826

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
OpenMP 5 lists under changes:

"The collapse of associated loops that are imperfectly nested loops was defined
for the worksharing-loop (see Section 2.9.2 on page 10), simd (see Section
2.9.3.1 on page 110), taskloop (see Section 2.10.2 on page 140) and distribute
(see Section 2.9.4.2 on page 123) constructs."

worksharing: https://www.openmp.org/spec-html/5.0/openmpsu41.html
simd:        https://www.openmp.org/spec-html/5.0/openmpsu42.html
taskloop:    https://www.openmp.org/spec-html/5.0/openmpsu47.html
distribute:  https://www.openmp.org/spec-html/5.0/openmpsu43.html

Both C and Fortran example compile with PGI, PGI does set the variable to
"x=5". 

The Intel compiler rejects C + Fortran code, Clang rejects the C example.

Hence:
– OpenMP 4.5:
  * gfortran has accept-invalid+diagnostic bug
- OpenMP 5:
  * gfortran needs to diagnose 'order(concurrent)'
    (once the 'order' clause is implemented)
  * gcc/g++/gfortran needs to handle intervening code in the other cases.
- OpenACC: need to reject the code.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/93826] [OpenMP][OpenACC] Collapsed loop – code silently ignored
       [not found] <bug-93826-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-05-22  8:37 ` burnus at gcc dot gnu.org
@ 2020-08-06  9:32 ` burnus at gcc dot gnu.org
  2020-08-06 12:53 ` dominiq at lps dot ens.fr
  4 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2020-08-06  9:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93826

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Missed to list the PR in the commit :-(

* OpenMP 4.5 patch which rejects this is the following:
https://gcc.gnu.org/pipermail/gcc-patches/2020-August/551338.html
and https://gcc.gnu.org/g:57dd9f3bfca8bb752c630431dc033c761e2ad382 (= r11-2553)

→ FIXED for OpenMP (4.5)
-------------
Tue, 4 Aug 2020 16:17:53 +0000 (18:17 +0200)
Fortran/OpenMP: Fix detecting not perfectly nested loops

gcc/fortran/ChangeLog:

* openmp.c (resolve_omp_do): Detect not perfectly
nested loop with innermost collapse.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/collapse1.f90: Add dg-error.
* gfortran.dg/gomp/collapse2.f90: New test.
-------------


TODO:

* OpenMP 5.x permits this (see also review comment)

* OpenACC: Still needs to be rejected

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/93826] [OpenMP][OpenACC] Collapsed loop – code silently ignored
       [not found] <bug-93826-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-08-06  9:32 ` burnus at gcc dot gnu.org
@ 2020-08-06 12:53 ` dominiq at lps dot ens.fr
  4 siblings, 0 replies; 5+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-08-06 12:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93826

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-08-06
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-06 12:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93826-4@http.gcc.gnu.org/bugzilla/>
2020-05-22  8:03 ` [Bug fortran/93826] [OpenMP][OpenACC] Collapsed loop – code silently ignored burnus at gcc dot gnu.org
2020-05-22  8:14 ` burnus at gcc dot gnu.org
2020-05-22  8:37 ` burnus at gcc dot gnu.org
2020-08-06  9:32 ` burnus at gcc dot gnu.org
2020-08-06 12:53 ` dominiq at lps dot ens.fr

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).