From 6b927641f37658c63ac5ade02e3e10d1a85c6463 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle <jvdelisle@gcc.gnu.org> Date: Sat, 15 Mar 2008 16:53:05 +0000 Subject: [PATCH] re PR fortran/35184 (ICE in gfc_conv_array_index_offset) 2008-03-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR testsuite/35184 gfortran.dg/elemental_subroutine_6.f90: New test. From-SVN: r133253 --- gcc/testsuite/ChangeLog | 5 ++++ .../gfortran.dg/elemental_subroutine_6.f90 | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/elemental_subroutine_6.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 48445d95e98b..ec3196b38d85 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-03-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR testsuite/35184 + gfortran.dg/elemental_subroutine_6.f90: New test. + 2008-03-15 Richard Guenther <rguenther@suse.de> * gcc.dg/pr23911.c: Adjust testcase. diff --git a/gcc/testsuite/gfortran.dg/elemental_subroutine_6.f90 b/gcc/testsuite/gfortran.dg/elemental_subroutine_6.f90 new file mode 100644 index 000000000000..aab33f39daee --- /dev/null +++ b/gcc/testsuite/gfortran.dg/elemental_subroutine_6.f90 @@ -0,0 +1,24 @@ +! { dg-do compile } +! PR35184 ICE in gfc_conv_array_index_offset +MODULE foo + TYPE, PUBLIC :: bar + PRIVATE + REAL :: value + END TYPE bar + INTERFACE ASSIGNMENT (=) + MODULE PROCEDURE assign_bar + END INTERFACE ASSIGNMENT (=) +CONTAINS + ELEMENTAL SUBROUTINE assign_bar (to, from) + TYPE(bar), INTENT(OUT) :: to + TYPE(bar), INTENT(IN) :: from + to%value= from%value + END SUBROUTINE + SUBROUTINE my_sub (in, out) + IMPLICIT NONE + TYPE(bar), DIMENSION(:,:), POINTER :: in + TYPE(bar), DIMENSION(:,:), POINTER :: out + ALLOCATE( out(1:42, 1:42) ) + out(1, 1:42) = in(1, 1:42) + END SUBROUTINE +END MODULE foo \ No newline at end of file -- GitLab