[PR fortran/60126] Internal compiler error with code using pointer reshaping (gfortran 4.8.2)

Harald Anlauf anlauf@gmx.de
Wed Feb 24 20:45:00 GMT 2016


On 02/24/16 20:42, Harald Anlauf wrote:
> Hello,
> 
> the above bug appears to have been fixed over 2.5 years ago.
> It does not trigger with 4.9, 5 and 6 trunk, but does with 4.8.0 and
> before.
> 
> I recommend to close the bug, while adding a testcase to the trunk's
> testsuite.  See e.g. the attached example.

I was missing the fact that the testsuite uses -pedantic-errors
which rejects the real*4 in the original testcase.  This non-standard
construct was not needed for the demonstration.  Fixed in the new
version.  Sorry for that.

Whoever wants to take it.

Harald

Index: gcc/testsuite/gfortran.dg/pr60126.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr60126.f90	(revision 0)
+++ gcc/testsuite/gfortran.dg/pr60126.f90	(revision 0)
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! PR fortran/60126 - ICE on pointer rank remapping
+! Based on testcase by Michel Valin <mfvalin at gmail dot com>
+
+subroutine simple_bug_demo
+  implicit none
+  interface
+     function offset_ptr_R4(nelements) result (dest)
+       implicit none
+       real, pointer, dimension(:) :: dest
+       integer, intent(IN) :: nelements
+     end function offset_ptr_R4
+  end interface
+
+  real, dimension(:,:), pointer :: R2D
+
+  R2D(-2:2,-3:3) => offset_ptr_R4(100)
+end


> 
> Harald
> 
> 2016-02-24  Harald Anlauf  <anlauf@gmx.de>
> 
> 	* gfortran.dg/pr60126.f90: New test.
> 
> 
> Index: gcc/testsuite/gfortran.dg/pr60126.f90
> ===================================================================
> --- gcc/testsuite/gfortran.dg/pr60126.f90	(revision 0)
> +++ gcc/testsuite/gfortran.dg/pr60126.f90	(revision 0)
> @@ -0,0 +1,18 @@
> +! { dg-do compile }
> +! PR fortran/60126 - ICE on pointer rank remapping
> +! Based on testcase by Michel Valin <mfvalin at gmail dot com>
> +
> +subroutine simple_bug_demo
> +  implicit none
> +  interface
> +     function offset_ptr_R4(nelements) result (dest)
> +       implicit none
> +       real*4, pointer, dimension(:) :: dest
> +       integer, intent(IN) :: nelements
> +     end function offset_ptr_R4
> +  end interface
> +
> +  real, dimension(:,:), pointer :: R2D
> +
> +  R2D(-2:2,-3:3) => offset_ptr_R4(100)
> +end
> 


-- 
Harald Anlauf
Dieburger Str. 17
60386 Frankfurt
Tel.: (069) 4014 8318



More information about the Gcc-patches mailing list