This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31608] wrong types in character array/scalar binop
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Oct 2007 08:47:06 -0000
- Subject: [Bug fortran/31608] wrong types in character array/scalar binop
- References: <bug-31608-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #26 from rguenther at suse dot de 2007-10-08 08:47 -------
Subject: Re: wrong types in character array/scalar binop
On Sun, 7 Oct 2007, pault at gcc dot gnu dot org wrote:
>
>
> ------- Comment #25 from pault at gcc dot gnu dot org 2007-10-07 12:49 -------
> (In reply to comment #17)
>
> >
> > the first line is correct, the second is not.
> >
>
> Richard, does this do it for you?
>
> {
> char char.3[1:1];
>
> char.3[1]{lb: 1 sz: 1} = (*(char[0:][1:1] *) atmp.0.data)[S.2][1]{lb: 1 sz:
> 1};
> (*(char[0:][1:1] *) atmp.1.data)[S.2] = char.3;
> }
The first line looks good, the second line not, as I think the middle-end
does not allow assignments of arrays - you have
char[1:1] = char[1:1]
here, so I think this should be
(*(char[0:][1:1] *) atmp.1.data)[S.2][1] = char.3[1];
instead. But the type checker should have complained (though it might
be imperfect there).
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31608