This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR fortran/60126] Internal compiler error with code using pointer reshaping (gfortran 4.8.2)
- From: Harald Anlauf <anlauf at gmx dot de>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 24 Feb 2016 21:44:48 +0100
- Subject: Re: [PR fortran/60126] Internal compiler error with code using pointer reshaping (gfortran 4.8.2)
- Authentication-results: sourceware.org; auth=none
- References: <56CE07AA dot 8090808 at gmx dot de>
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