aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2016-06-20 20:46:43 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2016-06-20 20:46:43 +0200
commitf1b5abfbbbdcecb62a0ed3c3904fb1233b4db8a9 (patch)
treef432ca0d97710e877f4c63d285bc0783b10bcbf7 /gcc/testsuite
parent842107e43de51855cd5870be1a67bc4eabca4a25 (diff)
downloadgcc-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/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/pointer_remapping_10.f9046
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