https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100094
--- Comment #3 from José Rui Faustino de Sousa <jrfsousa at gmail dot com> --- (In reply to kargl from comment #1) > Isn't the code invalid Fortran because it references an undefined pointer? > If yes, the compiler is allows to do whatever it wants with the code. AFAIK that is correct off all the "associate-like" constructs, the only exception is select rank. 11.1.10.3 Attributes of a SELECT RANK associate name, paragraph 3: "The associating entity has the ALLOCATABLE, POINTER, or TARGET attribute if the selector has that attribute. The other attributes of the associating entity are described in 11.1.3.3." Best regards, José Rui