http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59065
--- Comment #9 from Vittorio Zecca <zeccav at gmail dot com> --- Unfortunately associated() does not allow unassociated array pointers as input so your code works for allocatable arrays but not for array pointers. Yes, a negative value for size() is good. It is a pity there are not the human resources for detecting and handling access to unassociated array pointers. I stumbled into this issue by looking at abinit, a code in the public domain. I mean this is an example taken from a real life situation, it is not just fabricated as an exercise.