This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2005 00:55:21 -0000
- Subject: [Bug fortran/19362] ICE in fold_convert, at fold-const.c:1998
- References: <20050110142227.19362.coudert@clipper.ens.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2005-07-21 00:55 -------
The code of the original reporter is in fact not valid.
>From the Fortran 95 standard:
Section 4.4.2: "Two data entities have the same type if they are declared with
reference to the same derived-type definition."
Not the case here.
"...Data entities in different scoping units also have the same type if they
are declared with reference to different derived-type definitions that have
the same name (...)"
Also not the case here.
So the types of BAR and BAZ are not the same.
Section 7.5.1.2: "An intrinsic assignment statement is an assignment statement
where the shapes of variable and expr conform and where (...) [t]he types of
variable and expr are of the same derived type and no defined assignment
exists for objects of this type."
In this the types of variable (BAZ) and expr (BAR) are not the same, and there
is no defined assignment from T0 to T1. So the code is not legal Fortran.
Now, whether we should support this anyway is a different matter...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19362