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

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