https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86679
--- Comment #2 from janus at gcc dot gnu.org --- (In reply to janus from comment #0) > 1) We are casting a pointer to a variable ('i') that is not declared as > TARGET. gfortran should probably check that in the subroutine call the > TARGET attributes of formal and actual argument match. The question is whether this is actually invalid. In F18:15.5.2.4, I find the following: "11 If the dummy argument has the TARGET attribute and the effective argument does not have the TARGET attribute or is an array section with a vector subscript, any pointers associated with the dummy argument become undefined when execution of the procedure completes." To me that sounds like non-matching TARGET attributes are supposed to be valid (but any pointers we cast to it must be local to the procedure scope).