public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/107227] New: Compiler bug in private allocatable array in OpenACC compute statement
@ 2022-10-12  2:29 shb at gatech dot edu
  2022-10-12  7:26 ` [Bug libgomp/107227] " tschwinge at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: shb at gatech dot edu @ 2022-10-12  2:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107227
           Summary: Compiler bug in private allocatable array in OpenACC
                    compute statement
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shb at gatech dot edu
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

The program below does not compile (nor does any variant of it involving
allocatable statements that I can think of). 
```
program main
integer :: i
real, allocatable :: arr(:)
allocate(arr(10))
!$acc parallel loop private(arr)
do i=1,10
    arr=1.0
end do
end
```

The error is 
```
!$acc parallel loop private(arr)
      |                                ^
internal compiler error: in expand_oacc_for, at omp-expand.cc:7660
```

A version of this suggested by Mat Colgrove also does not work:
```
program main
integer :: i
real, allocatable :: arr(:)
allocate(arr(10))
!$acc parallel loop private(arr(1:10)
do i=1,10
    arr=1.0
end do
end
```

with error

```

    5 | !$acc parallel loop private(arr(1:10))
      |                                1
Error: Syntax error in OpenMP variable list at (1)
```

These appear to be ICE compiler bugs as they are permitted by quite old OpenaCC
standards (and are seemingly typical use cases of OpenACC in Fortran). nvhpc
compilers work fine for this. 

The compile statement is 
`gfortran -foffload-options=-march=gfx90a -fopenacc test.f90`
with offloading onto an AMD MI210.

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

* [Bug libgomp/107227] Compiler bug in private allocatable array in OpenACC compute statement
  2022-10-12  2:29 [Bug libgomp/107227] New: Compiler bug in private allocatable array in OpenACC compute statement shb at gatech dot edu
@ 2022-10-12  7:26 ` tschwinge at gcc dot gnu.org
  2022-10-12  8:03 ` tschwinge at gcc dot gnu.org
  2022-10-12 12:32 ` shb at gatech dot edu
  2 siblings, 0 replies; 4+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-10-12  7:26 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-10-12
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |tschwinge at gcc dot gnu.org

--- Comment #1 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Thanks for the report!

Probably a duplicate of PR93554: exactly same ICE, backtrace.

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

* [Bug libgomp/107227] Compiler bug in private allocatable array in OpenACC compute statement
  2022-10-12  2:29 [Bug libgomp/107227] New: Compiler bug in private allocatable array in OpenACC compute statement shb at gatech dot edu
  2022-10-12  7:26 ` [Bug libgomp/107227] " tschwinge at gcc dot gnu.org
@ 2022-10-12  8:03 ` tschwinge at gcc dot gnu.org
  2022-10-12 12:32 ` shb at gatech dot edu
  2 siblings, 0 replies; 4+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2022-10-12  8:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
(In reply to Spencer Bryngelson from comment #0)
>     5 | !$acc parallel loop private(arr(1:10))
>       |                                1
> Error: Syntax error in OpenMP variable list at (1)

That's because, at this time, OpenACC subarray specifications do not apply to
'private' clauses, but only to data clauses.

This is being discussed in <https://github.com/OpenACC/openacc-spec/issues/59>
"private clause with subarrays" (only available to members of the GitHub
OpenACC organization).

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

* [Bug libgomp/107227] Compiler bug in private allocatable array in OpenACC compute statement
  2022-10-12  2:29 [Bug libgomp/107227] New: Compiler bug in private allocatable array in OpenACC compute statement shb at gatech dot edu
  2022-10-12  7:26 ` [Bug libgomp/107227] " tschwinge at gcc dot gnu.org
  2022-10-12  8:03 ` tschwinge at gcc dot gnu.org
@ 2022-10-12 12:32 ` shb at gatech dot edu
  2 siblings, 0 replies; 4+ messages in thread
From: shb at gatech dot edu @ 2022-10-12 12:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Spencer Bryngelson <shb at gatech dot edu> ---
Thanks @tschwinge! I found a few other replicate issues now that I look further
back, going at least to gcc10. Is there a plan to fix this? It seems important
(at least to me).

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

end of thread, other threads:[~2022-10-12 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12  2:29 [Bug libgomp/107227] New: Compiler bug in private allocatable array in OpenACC compute statement shb at gatech dot edu
2022-10-12  7:26 ` [Bug libgomp/107227] " tschwinge at gcc dot gnu.org
2022-10-12  8:03 ` tschwinge at gcc dot gnu.org
2022-10-12 12:32 ` shb at gatech dot edu

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