gcc/libgomp/testsuite/libgomp.oacc-fortran/pr96628-part2.f90
Tom de Vries 344f09a756 [nvptx] Handle V2DI/V2SI mode in nvptx_gen_shuffle
With the pr96628-part1.f90 source and -ftree-slp-vectorize, we run into an
ICE due to the fact that V2DI mode is not handled in nvptx_gen_shuffle.

Fix this by adding handling of V2DI as well as V2SI mode in
nvptx_gen_shuffle.

Build and reg-tested on x86_64 with nvptx accelerator.

gcc/ChangeLog:

	PR target/96428
	* config/nvptx/nvptx.c (nvptx_gen_shuffle): Handle V2SI/V2DI.

libgomp/ChangeLog:

	PR target/96428
	* testsuite/libgomp.oacc-fortran/pr96628-part1.f90: New test.
	* testsuite/libgomp.oacc-fortran/pr96628-part2.f90: New test.
2020-08-04 11:59:08 +02:00

38 lines
693 B
Fortran

! { dg-do compile { target skip-all-targets } }
!
! Main file is pr96628-part1.f90
MODULE m
IMPLICIT NONE
REAL*8, ALLOCATABLE :: t(:)
CONTAINS
SUBROUTINE run()
use m2
IMPLICIT NONE
INTEGER :: i,j ! loop indices
!$acc data present(t)
!$acc parallel
!$acc loop gang
DO j = 1,2
!$acc loop vector
DO i = 1,2
CALL one(t(:))
CALL two(t(:))
END DO
END DO
!$acc end parallel
!$acc end data
END SUBROUTINE run
END MODULE m
use m
implicit none
integer :: i
t = [(3.0_8*i, i = 1, 100)]
!$acc data copy(t)
call run
!$acc end data
if (any (abs(t - [((300.0_8*i)/15150.0_8, i = 1, 100)]) < 10.0_8*epsilon(t))) stop 1
end