re PR fortran/49624 (ICE with pointer-bound remapping)
authorTobias Burnus <burnus@net-b.de>
Sun, 17 Jul 2011 14:52:46 +0000 (16:52 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Sun, 17 Jul 2011 14:52:46 +0000 (16:52 +0200)
2011-07-17  Tobias Burnus  <burnus@net-b.de>

        PR fortran/49624
        * expr.c (gfc_check_pointer_assign): Fix checking for invalid
        pointer bounds.

2011-07-17  Tobias Burnus  <burnus@net-b.de>

        PR fortran/49624
        * gfortran.dg/pointer_remapping_7.f90: New.

From-SVN: r176370

gcc/fortran/ChangeLog
gcc/fortran/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pointer_remapping_7.f90 [new file with mode: 0644]

index 4321c2fb061a15d0ddd05306ccd8f8a00a3f0894..19339a6a13fb1e76f7ec5f5521dd85c7a1b5d56f 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-17  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/49624
+       * expr.c (gfc_check_pointer_assign): Fix checking for invalid
+       pointer bounds.
+
 2011-07-16  Tobias Burnus  <burnus@net-b.de>
        
        * expr.c (gfc_ref_this_image): New function.
index 3bf1e94bda88317d679dd22658d32e5c800d5569..b8eb5552a40e554eff8ed2df8657713ef3c65678 100644 (file)
@@ -3286,7 +3286,8 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
             upper bounds are present, we may do rank remapping.  */
          for (dim = 0; dim < ref->u.ar.dimen; ++dim)
            {
-             if (!ref->u.ar.start[dim])
+             if (!ref->u.ar.start[dim]
+                 || ref->u.ar.dimen_type[dim] != DIMEN_RANGE)
                {
                  gfc_error ("Lower bound has to be present at %L",
                             &lvalue->where);
index ffecc486dc7ce228d9f6b382e8f19af898d61b22..6abed53c2aa1b36cc2027cffc7985245dec7eed3 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-17  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/49624
+       * gfortran.dg/pointer_remapping_7.f90: New.
+
 2011-07-16  Jason Merrill  <jason@redhat.com>
 
        * lib/prune.exp (prune_gcc_output): Prune "In substitution" too.
diff --git a/gcc/testsuite/gfortran.dg/pointer_remapping_7.f90 b/gcc/testsuite/gfortran.dg/pointer_remapping_7.f90
new file mode 100644 (file)
index 0000000..39126ba
--- /dev/null
@@ -0,0 +1,8 @@
+! { dg-do compile }
+!
+! PR fortran/49624
+!
+  integer, target :: A(100)
+  integer,pointer :: P(:,:)
+  p(10,1:) => A  ! { dg-error "Lower bound has to be present" }
+  end