2008-09-06 Steven G. Kargl <kargls@comcast.net>
+ PR fortran/36153
+ * fortran/resolve.c (resolve_function): Shortcircuit for SIZE and
+ UBOUND if 2nd argument is KIND.
+
+2008-09-06 Steven G. Kargl <kargls@comcast.net>
+
PR fortran/33229
* resolve.c (resolve_function): An intrinsic subroutine should not be
called as a function.
assumed size array argument. UBOUND and SIZE have to be
excluded from the check if the second argument is anything
than a constant. */
- int inquiry;
- inquiry = GENERIC_ID == GFC_ISYM_UBOUND
- || GENERIC_ID == GFC_ISYM_SIZE;
for (arg = expr->value.function.actual; arg; arg = arg->next)
{
- if (inquiry && arg->next != NULL && arg->next->expr)
+ if ((GENERIC_ID == GFC_ISYM_UBOUND || GENERIC_ID == GFC_ISYM_SIZE)
+ && arg->next != NULL && arg->next->expr)
{
if (arg->next->expr->expr_type != EXPR_CONSTANT)
break;
+ if (arg->next->name && strncmp(arg->next->name, "kind", 4) == 0)
+ break;
+
if ((int)mpz_get_si (arg->next->expr->value.integer)
< arg->expr->rank)
break;
+2008-09-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/36153
+ * gfortran.dg/size_kind.f90: New test.
+
2008-09-06 Steven G. Kargl <kargls@comcast.net>
PR fortran/33229
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/36153
+! Contributed by Jonathan Hogg
+!
+program test_64
+ implicit none
+
+ integer, parameter :: long = selected_int_kind(18)
+ integer, parameter :: short = kind(0)
+
+ integer(long), parameter :: big_sz = huge(0_short)+1000_long
+ integer(long), parameter :: max_32 = huge(0_short)
+ integer, dimension(:), allocatable :: array
+
+ integer(long) :: i
+
+ print *, "2**31 = ", 2_long**31
+ print *, "max_32 = ", max_32
+ print *, "big_sz = ", big_sz
+
+ allocate(array(big_sz))
+ print *, "sz = ", size(array)
+ print *, "sz = ", size(array, kind=long)
+end program