------- Comment #2 from burnus at gcc dot gnu dot org 2007-10-12 20:20 ------- There is another bug (accepts-invalid): integer, intent(out) :: jp(2,*) jp(3,2:4)=0 which is not diagnosed at compile time.
The wrong-code bug is fixed by the followed patch. Index: trans-array.c =================================================================== --- trans-array.c (revision 129272) +++ trans-array.c (working copy) @@ -2870,7 +2870,7 @@ gfc_conv_ss_startstride (gfc_loopinfo * if (info->ref->u.ar.dimen_type[dim] != DIMEN_RANGE) continue; - if (n == info->ref->u.ar.dimen - 1 + if (n == info->ref->u.ar.dimen - 2 && (info->ref->u.ar.as->type == AS_ASSUMED_SIZE || info->ref->u.ar.as->cp_was_assumed)) check_upper = false; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33745