[Bug fortran/71723] [5/6/7 Regression] [F08] ICE on invalid pointer initialization
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Nov 19 10:08:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71723
--- Comment #9 from janus at gcc dot gnu.org ---
(In reply to Walter Spector from comment #8)
> The newer F2008 data pointer initialization stuff is largely in §4.5.4.6,
> paragraph 2:
>
> "A pointer variable or component is data-pointer-initialization compatible
> with a target if the pointer is type compatible with the target, they have
> the same rank, all nondeferred type parameters of the pointer have the same
> values as the corresponding type parameters of the target, and the target is
> contiguous if the pointer has the CONTIGUOUS attribute."
>
> Note the repeated use of the word "target". :)
Thanks for that reference. What I find even more relevant for our example is:
R443 initial-data-target is designator
and:
C461 (R443) The designator shall designate a nonallocatable variable that has
the TARGET and SAVE attributes and does not have a vector subscript. Every
subscript, section subscript, substring starting point, and substring ending
point in designator shall be a constant expression.
That explicitly mentions only the TARGET attribute, but not POINTER (which is
in fact mentioned for normal pointer assignment statements). So, I think you're
right with your interpretation that the example is invalid.
[Btw, we possibly also fail to check for the SAVE attribute.]
More information about the Gcc-bugs
mailing list