This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, Fortran] PR54788 ICE on pointer-array element assignment


Dear all,

The following patchlet fixes the ICE for the test case bellow and AFAICT
gives the right error.  Regstrapped on x86_64-apple-darwin10.8.0.  

OK for the trunk?

Dominiaue

2013-06-28  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/54788
	* array.c (spec_size): handle the case as==NULL.

2013-06-28  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR fortran/54788
	* gfortran.dg/pointer_remapping_8.f90: New.


--- ../_clean/gcc/fortran/array.c	2013-06-08 11:35:26.000000000 +0200
+++ gcc/fortran/array.c	2013-06-27 11:06:24.000000000 +0200
@@ -2084,7 +2084,7 @@ spec_size (gfc_array_spec *as, mpz_t *re
   mpz_t size;
   int d;
 
-  if (as->type == AS_ASSUMED_RANK)
+  if (!as || as->type == AS_ASSUMED_RANK)
     return false;
 
   mpz_init_set_ui (*result, 1);
--- ../_clean/gcc/testsuite/gfortran.dg/pointer_remapping_8.f90	1970-01-01 01:00:00.000000000 +0100
+++ gcc/testsuite/gfortran.dg/pointer_remapping_8.f90	2013-06-27 23:04:39.000000000 +0200
@@ -0,0 +1,10 @@
+! { dg-do compile }
+!
+! PR 54788 ICE on pointer-array element assignment
+!
+program bug
+  integer, pointer :: a(:)
+  integer :: b
+  allocate(a(0:0))
+  a(0:0) => b ! { dg-error "Rank remapping target must be rank 1 or simply contiguous" }
+end


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]