PR fortran/35685
* trans-intrinsic.c (gfc_conv_intrinsic_bound): Correctly
handle zero-size sections.
* gfortran.dg/bound_3.f90: New test.
From-SVN: r135305
+2008-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/35685
+ * trans-intrinsic.c (gfc_conv_intrinsic_bound): Correctly
+ handle zero-size sections.
+
2008-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36215
size = fold_build2 (MINUS_EXPR, gfc_array_index_type, ubound, lbound);
se->expr = fold_build2 (PLUS_EXPR, gfc_array_index_type, size,
gfc_index_one_node);
+ se->expr = fold_build2 (MAX_EXPR, gfc_array_index_type, se->expr,
+ gfc_index_zero_node);
}
else
se->expr = gfc_index_one_node;
+2008-05-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/35685
+ * gfortran.dg/bound_3.f90: New test.
+
2008-05-14 Michael Meissner <michael.meissner@amd.com>
Dwarakanath Rajagopal <dwarak.rajagopal@amd.com>
--- /dev/null
+! { dg-do run }
+!
+ call s(1,0)
+ call s(2,0)
+ call s(3,0)
+ call s(4,0)
+ call s(5,1)
+ call s(6,2)
+ call s(7,3)
+contains
+ subroutine s(n,m)
+ implicit none
+ integer n, m
+ real x(10)
+ if (any (lbound(x(5:n)) /= 1)) call abort
+ if (lbound(x(5:n),1) /= 1) call abort
+ if (any (ubound(x(5:n)) /= m)) call abort
+ if (ubound(x(5:n),1) /= m) call abort
+ end subroutine
+end program