This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] PR57508 - Fix ICE/Reject-valid issue with get_temp_from_expr (intrinsic assignment with defined assignment)
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>, Janus Weil <janus at gcc dot gnu dot org>
- Date: Tue, 11 Jun 2013 12:58:49 +0200
- Subject: Re: [Patch, Fortran] PR57508 - Fix ICE/Reject-valid issue with get_temp_from_expr (intrinsic assignment with defined assignment)
- References: <51ACA2CB dot 6010601 at net-b dot de> <51B441D6 dot 9030200 at sfr dot fr> <51B6F553 dot 4000008 at net-b dot de>
Le 11/06/2013 12:00, Tobias Burnus a écrit :
> Hello Mikael,
>
> Mikael Morin wrote:
>> Le 03/06/2013 16:06, Tobias Burnus a écrit :
>>> diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
>>> index b2e8fdc..655d3c1 100644
>>> --- a/gcc/fortran/resolve.c
>>> +++ b/gcc/fortran/resolve.c
>>> @@ -9293,8 +9293,12 @@ get_temp_from_expr (gfc_expr *e, gfc_namespace
>>> *ns)
>>> }
>>> }
>>> /* Add the attributes and the arrayspec to the temporary. */
>>> /* Add the attributes and the arrayspec to the temporary. */
>>> tmp->n.sym->attr = gfc_expr_attr (e);
>>> + tmp->n.sym->attr.function = 0;
>>> + tmp->n.sym->attr.result = 0;
>>> + tmp->n.sym->attr.flavor = FL_VARIABLE;
>>> +
>>> if (as)
>>> {
>>> tmp->n.sym->as = gfc_copy_array_spec (as);
>> This fixes the problem, but shouldn't the fix be in gfc_expr_attr
>> instead?
>> It seems to me that most symbol attributes don't make sense in any case
>> for non-variables, except for some of the standard ones
>> (allocatable,...) and possibly a couple more.
>
> I will audit the use of gfc_expr_attr and send an updated patch later.
>
> Is the current patch okay for GCC 4.8? I prefer simpler patches for the
> branch.
>
Yes.