This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/83920] [nvptx] bad predicate reset
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 18 Jan 2018 16:38:21 +0000
- Subject: [Bug target/83920] [nvptx] bad predicate reset
- Auto-submitted: auto-generated
- References: <bug-83920-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83920
--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #3)
> Likewise, reversing the if-then-else order in gemm.f90 makes the testcase
> fail on trunk without this patch.
Minimal version:
...
! { dg-do run }
subroutine gemm (BETA, C)
real :: C(100,100)
integer :: i, j, l
real, parameter :: one = 1.0
real :: beta
!$acc parallel copy(c(1:100,1:100)) num_gangs(2)
!$acc loop gang
do j = 1, 100
if (beta /= one) then
!$acc loop vector
do i = 1, 100
C(i,j) = 0.0
end do
end if
end do
!$acc end parallel
end subroutine gemm
program test_gemm
real :: c(100,100), beta
beta = 0.0
c(:,:) = 1.0
call gemm (beta, c)
if (c(1,1) /= 0.0) call abort ()
end program test_gemm
...
Passes at O0, fails at O1 and higher.