[Bug fortran/94129] New: Using almost any openacc !$acc directive causes ICE "compressed stream: data error"

2020-03-10 Thread andrew at blamsoft dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94129

Bug ID: 94129
   Summary: Using almost any openacc !$acc directive causes ICE
"compressed stream: data error"
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andrew at blamsoft dot com
  Target Milestone: ---

I am using the Ubuntu gcc/gfortran 10 packages with nvptx offloading.
Specifically, the packages are gfortran-10 and gcc-10-offload-nvptx. The
specific versions are:

GNU Fortran (Ubuntu 10-20200304-1ubuntu1) 10.0.1 20200304 (experimental)
[master revision
0b0908c1f27:cb0a7e0ca53:94f7d7ec6ebef49a50da777fd71db3d03ee03aa0]

gcc (Ubuntu 10-20200304-1ubuntu1) 10.0.1 20200304 (experimental) [master
revision 0b0908c1f27:cb0a7e0ca53:94f7d7ec6ebef49a50da777fd71db3d03ee03aa0]

When trying to use openacc I get the following ICE.

0x8bc90a lto_uncompression_zlib
../../src-nvptx/gcc/lto-compress.c:393
0x8bc90a lto_end_uncompression(lto_compression_stream*, lto_compression)
../../src-nvptx/gcc/lto-compress.c:415
0x8bac1e lto_get_section_data(lto_file_decl_data*, lto_section_type, char
const*, int, unsigned long*, bool)
../../src-nvptx/gcc/lto-section-in.c:166
0x8ac51b lto_input_mode_table(lto_file_decl_data*)
../../src-nvptx/gcc/lto-streamer-in.c:1603
0x5c776d lto_file_finalize
../../src-nvptx/gcc/lto/lto-common.c:2200
0x5c776d lto_create_files_from_ids
../../src-nvptx/gcc/lto/lto-common.c:2237
0x5c776d lto_file_read
../../src-nvptx/gcc/lto/lto-common.c:2292
0x5c776d read_cgraph_and_symbols(unsigned int, char const**)
../../src-nvptx/gcc/lto/lto-common.c:2744
0x5b6466 lto_main()
../../src-nvptx/gcc/lto/lto.c:630
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
mkoffload: fatal error: x86_64-linux-gnu-accel-nvptx-none-gcc-10 returned 1
exit status
compilation terminated.
lto-wrapper: fatal error:
/usr/lib/gcc/x86_64-linux-gnu/10//accel/nvptx-none/mkoffload returned 1 exit
status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

I have found that using "data" and "host_data" work. Any other directive I try
such as "parallel" or "kernels" causes a crash. Here is a tutorial program I
found that causes the crash. I could not find any simple program online that
didn't crash.

program main

! Size of vectors
integer :: n = 1

! Input vectors
real(8),dimension(:),allocatable :: a
real(8),dimension(:),allocatable :: b 
! Output vector
real(8),dimension(:),allocatable :: c

integer :: i
real(8) :: sum

! Allocate memory for each vector
allocate(a(n))
allocate(b(n))
allocate(c(n))

! Initialize content of input vectors, vector a[i] = sin(i)^2 vector b[i] =
cos(i)^2
do i=1,n
a(i) = sin(i*1D0)*sin(i*1D0)
b(i) = cos(i*1D0)*cos(i*1D0) 
enddo

! Sum component wise and save result into vector c

!$acc kernels copyin(a(1:n),b(1:n)), copyout(c(1:n))
do i=1,n
c(i) = a(i) + b(i)
enddo
!$acc end kernels

! Sum up vector c and print result divided by n, this should equal 1 within
error
do i=1,n
sum = sum +  c(i)
enddo
sum = sum/n
print *, 'final result: ', sum

! Release memory
deallocate(a)
deallocate(b)
deallocate(c)

end program

Compile with:
gfortran -fopenacc program.f90

[Bug fortran/90519] ICE (segfault) on derived type which has a recursive allocatable component of the same type, and a static component of another type which has a "final" attribute

2020-01-13 Thread andrew at blamsoft dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90519

Andrew B  changed:

   What|Removed |Added

 CC||andrew at blamsoft dot com

--- Comment #3 from Andrew B  ---
This related code will crash gfortran 9.2.1.

module m
type t
type(t), allocatable :: a
contains
final :: my_final
end type

contains
subroutine my_final(self)
type(t) :: self
end subroutine
end module

Also crashes if my_final is specified as recursive.

[Bug fortran/46539] libquadmath: Add -static-libquadmath

2020-02-01 Thread andrew at blamsoft dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539

Andrew B  changed:

   What|Removed |Added

 CC||andrew at blamsoft dot com

--- Comment #6 from Andrew B  ---
It would be great to be able to share a binary with just operating system
supplied dynamic libraries. After reading posts about it and looking at otool
-L, it seems like this is what is needed.