https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68813
Bug ID: 68813
Summary: [openacc] lto1: internal compiler error: in
input_varpool_node, at lto-cgraph.c
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
Consider OpenACC testcase test.f90:
...
program foo
implicit none
integer, parameter :: n = 100
integer, dimension(n,n) :: a
integer :: i, j, sum = 0
a = 1
!$acc parallel copyin(a(1:n,1:n)) firstprivate (sum)
!$acc loop gang reduction(+:sum)
do i=1, n
!$acc loop vector reduction(+:sum)
do j=1, n
sum = sum + a(i, j)
enddo
enddo
!$acc end parallel
end program
...
When compiling like this with a compiler configured for offloading:
...
$ gfortran -O2 -fopenacc-lm -foffload=-lm test.f90
...
We run into:
...
lto1: internal compiler error: in input_varpool_node, at lto-cgraph.c:1412
0xa88e5b input_varpool_node
gcc/lto-cgraph.c:1410
0xa893d1 input_cgraph_1
gcc/lto-cgraph.c:1534
0xa89fde input_symtab()
gcc/lto-cgraph.c:1843
0x6e42bc read_cgraph_and_symbols
gcc/lto/lto.c:2846
0x6e5125 lto_main()
gcc/lto/lto.c:3263
Please submit a full bug report,
with preprocessed source if appropriate.
...
I'm not sure the example is legal, but we shouldn't ICE.