This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Fix for PR fortran/21375
Steve Kargl wrote:
>>Other than that this is ok. I'd prefer, if ...
>>
>>
>>>+ (2) deallocate(a1, a2, a3, stat=i) is translated into the following
>>>+ _gfortran_deallocate(a1, &stat)
>>>+ astat = sat
>>>+ _gfortran_deallocate(a2, &stat)
>>>+ astat = astat + stat
>>>+ _gfortran_deallocate(a3, &stat)
>>>+ astat = astat + stat
>>>+ In case (1), we simply return at the end of the for loop. In case (2)
>>>+ we set STAT= astat. */
>>
>>... you changed that to initialize 'astat' to zero, and then always
>>incrementing by 'stat', this way you could do away with the special case.
>
>
> I agree. But in my 10+ hours of trying to figure out how tree-ssa
> stuff works, I never stumbled on the magic incantation on how to
> initialize a variable.
I thought that
gfc_add_modify_expr (&block, astat, build_int_cst (TREE_TYPE (astat), 0));
would work or is something else the problem?
- Tobi