This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix for PR fortran/21375


Steve Kargl wrote:
> 2005-06-04  Steven G. Kargl  <kargls@comcast.net>
> 
> 	PR fortran/17792
> 	PR fortran/21375
> 	* trans-array.c (gfc_array_deallocate): pstat is new argument
> 	(gfc_array_allocate): update gfc_array_deallocate() call.
> 	(gfc_trans_deferred_array): ditto.
> 	* trans-array.h: update gfc_array_deallocate() prototype.
> 	* trans-decl.c (gfc_build_builtin_function_decls): update declaration
> 	* trans-stmt.c (gfc_trans_deallocate): Implement STAT= feature.
> 
> 2005-06-04  Steven G. Kargl  <kargls@comcast.net>
>   
> 	PR fortran/17792
> 	PR fortran/21375
> 	* gfortran.dg/pr21375.f90:  New test.

Please give testcases expressive names.  The PR number can always be looked up
in the testcase itdelf, the ChangeLog and CVS history.  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.

- Tobi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]