[Bug fortran/98022] [9/10/11 Regression] ICE in gfc_assign_data_value, at fortran/data.c:468 since r9-3803-ga5fbc2f36a291cbe
pault at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Dec 12 16:02:54 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98022
--- Comment #6 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to kargl from comment #4)
> (In reply to Paul Thomas from comment #3)
>
> > function kn1() result(hm2)
> > complex :: hm(1:2), hm2(1:2)
> > data (hm(md)%re, md=1,2)/1.0, 2.0/
> > hm2 = hm
> > end function kn1
>
> Are you sure that this is valid Fortran? I cannot
> find anything in the Fortran standard that says hm%im
> is defined. Thus, 'hm2=hm' is referencing a variable
> that is no completely defined.
>
>
> 19.6.1 Definition of objects and subobjects
>
> 2 Arrays, including sections, and variables of derived, character,
> or complex type are objects that consist of zero or more subobjects.
> Associations may be established between variables and subobjects and
> between subobjects of different variables. These subobjects may become
> defined or undefined.
>
> 5 A complex or character scalar object is defined if and only if all
> of its subobjects are defined.
Hi Steve,
I saw your comment a bit too late. I think that you are correct. I guess that,
at very least, I should not zero out the undefined part of the complex object?
That way it would be equivalent to using assignment to achieve the same thing
or to partially define a derived type.
I'll post on clf.
Cheers
Paul
More information about the Gcc-bugs
mailing list