https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90350
Bug ID: 90350 Summary: ubound ICE on assumed size array even though explicit bound is specified Product: gcc Version: 7.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: urbanjost at comcast dot net Target Milestone: --- Created attachment 46291 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46291&action=edit call UBOUND(3f) with an assumed-size array but with an explicit size on the upper bound Even an assumed size array should be able to be passed to UBOUND if an explicit size is specified (well, that is the way I read the standard :>). This problem only appeared while transitioning some F77 code to a modern syntax but it produced an ICE. Once updated completely the code works great with gfortran, by the way. A reduced reproducer is attached. The error is write(*,*)'UPPER=',ubound(arr(:n)) internal compiler error: in gfc_conv_intrinsic_bound, at fortran/trans-intrinsic.c:2735 Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions. The test has been reduced to the point where it is redundant to even call UBOUND but it still produces the ICE, which is what I assuming you want to look at; but unless I encounter this in some other form consider this a low priority request. As always, thanks!