The following out-of-bounds problem (in the if clause) is not detected:
character, pointer :: ptr(:)
allocate(ptr(9))
ptr = transfer('Sample#0'//achar(0),ptr) ! Causes ICE
if (any (ptr .ne. ['S','a','m','p','l','e','#','0'])) call abort
end
NAG f95 finds:
Rank 1 of array operand has extent 9 instead of 8
--
Summary: Bounds-check of array-pointer == [ constructor ]
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34741