public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PR fortran/60126] Internal compiler error with code using pointer reshaping (gfortran 4.8.2)
@ 2016-02-24 19:42 Harald Anlauf
  2016-02-24 20:45 ` Harald Anlauf
  0 siblings, 1 reply; 3+ messages in thread
From: Harald Anlauf @ 2016-02-24 19:42 UTC (permalink / raw)
  To: fortran, gcc-patches

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.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [PR fortran/60126] Internal compiler error with code using pointer reshaping (gfortran 4.8.2)
@ 2016-02-24 21:24 Dominique d'Humières
  0 siblings, 0 replies; 3+ messages in thread
From: Dominique d'Humières @ 2016-02-24 21:24 UTC (permalink / raw)
  To: anlauf; +Cc: fortran

Hi Harald,

> I was missing the fact that the testsuite uses -pedantic-errors
> which rejects the real*4 in the original testcase.

This can be disabled by passing an option. I have been recently bitten by that, but I don’t remember right now the details.

If nobody beats me, I’ll commit the test next Sunday.

Thanks,

Dominique

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-24 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-24 19:42 [PR fortran/60126] Internal compiler error with code using pointer reshaping (gfortran 4.8.2) Harald Anlauf
2016-02-24 20:45 ` Harald Anlauf
2016-02-24 21:24 Dominique d'Humières

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).