+2020-04-22 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/90350
+ * simplify.c (simplify_bound): In the case of assumed-size arrays
+ check if the reference is to a full array.
+
2020-04-22 Tobias Burnus <tobias@codesourcery.com>
PR fortran/94709
{
gfc_ref *ref;
gfc_array_spec *as;
+ ar_type type = AR_UNKNOWN;
int d;
if (array->ts.type == BT_CLASS)
switch (ref->type)
{
case REF_ARRAY:
+ type = ref->u.ar.type;
switch (ref->u.ar.type)
{
case AR_ELEMENT:
int k;
/* UBOUND(ARRAY) is not valid for an assumed-size array. */
- if (upper && as && as->type == AS_ASSUMED_SIZE)
+ if (upper && type == AR_FULL && as && as->type == AS_ASSUMED_SIZE)
{
/* An error message will be emitted in
check_assumed_size_reference (resolve.c). */
+2020-04-22 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/90350
+ * gfortran.dg/PR90350.f90: New test.
+
2020-04-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/90448
--- /dev/null
+! { dg-do compile }
+!
+! Test the fix for PR90350
+!
+! Contributed by <urbanjost@comcast.net>
+!
+
+program artificial
+implicit none
+integer :: arr(-10:10)
+ call asub(arr,size(arr))
+end program artificial
+subroutine asub(arr,n)
+integer,intent(in) :: arr(*)
+integer,intent(in) :: n
+ write(*,*)'UPPER=',ubound(arr(:n))
+ write(*,*)'LOWER=',lbound(arr(:n))
+ write(*,*)'SIZE=',size(arr(:n))
+end subroutine asub