[Patch, Fortran] PR57508 - Fix ICE/Reject-valid issue with get_temp_from_expr (intrinsic assignment with defined assignment)
Tobias Burnus
burnus@net-b.de
Tue Jun 11 10:01:00 GMT 2013
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.
Tobias
PS: Still pending review: [Patch, Fortran] PR57535 - Fix class-array
handling for function result variables,
http://gcc.gnu.org/ml/fortran/2013-06/msg00053.html
More information about the Fortran
mailing list