diff options
author | Tobias Burnus <burnus@net-b.de> | 2016-06-20 20:46:43 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2016-06-20 20:46:43 +0200 |
commit | f1b5abfbbbdcecb62a0ed3c3904fb1233b4db8a9 (patch) | |
tree | f432ca0d97710e877f4c63d285bc0783b10bcbf7 /gcc/testsuite | |
parent | 842107e43de51855cd5870be1a67bc4eabca4a25 (diff) | |
download | gcc-f1b5abfbbbdcecb62a0ed3c3904fb1233b4db8a9.zip gcc-f1b5abfbbbdcecb62a0ed3c3904fb1233b4db8a9.tar.gz gcc-f1b5abfbbbdcecb62a0ed3c3904fb1233b4db8a9.tar.bz2 |
re PR fortran/71194 (ICE on compilation with fcheck=all ; -fcheck=bounds)
2016-06-20 Tobias Burnus <burnus@net-b.de>
fortran/71194
* trans-expr.c (gfc_trans_pointer_assignment): Correctly handle
RHS pointer functions.
2016-06-20 Tobias Burnus <burnus@net-b.de>
PR fortran/71194
* gfortran.dg/pointer_remapping_10.f90: New.
From-SVN: r237612
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pointer_remapping_10.f90 | 46 |
2 files changed, 51 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1d43852..d42a9d7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-20 Tobias Burnus <burnus@net-b.de> + + PR fortran/71194 + * gfortran.dg/pointer_remapping_10.f90: New. + 2016-06-20 David Malcolm <dmalcolm@redhat.com> * g++.dg/diagnostic/string-literal-concat.C: New test case. diff --git a/gcc/testsuite/gfortran.dg/pointer_remapping_10.f90 b/gcc/testsuite/gfortran.dg/pointer_remapping_10.f90 new file mode 100644 index 0000000..4810506 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pointer_remapping_10.f90 @@ -0,0 +1,46 @@ +! { dg-do run } +! { dg-options "-fcheck=all" } +! +! PR fortran/71194 +! +! Contributed by T Kondic +! +program ice +implicit none +integer, parameter :: pa=10, pb=20 +complex, target :: a(pa*pb) +real, pointer:: ptr(:,:) =>null() +integer :: i, j, cnt +logical :: negative + + do i = 1, size(a) + a(i) = cmplx(i,-i) + end do + + ! Was ICEing before with bounds checks + ptr(1:pa*2,1:pb) => conv2real(a) + + negative = .false. + cnt = 1 + do i = 1, ubound(ptr,dim=2) + do j = 1, ubound(ptr,dim=1) + if (negative) then + if (-cnt /= ptr(j, i)) call abort() + cnt = cnt + 1 + negative = .false. + else + if (cnt /= ptr(j, i)) call abort() + negative = .true. + end if + end do + end do + +contains + function conv2real(carr) + use, intrinsic :: iso_c_binding + ! returns real pointer to a complex array + complex, contiguous, intent(inout), target :: carr(:) + real,contiguous,pointer :: conv2real(:) + call c_f_pointer(c_loc(carr),conv2real,[size(carr)*2]) + end function conv2real +end program |