[Patch, fortran] PR20779 and PR20891 - allocation of STAT or specification variables in same call
Paul Thomas
paulthomas2@wanadoo.fr
Mon Sep 18 17:20:00 GMT 2006
Bother! Sorry about forgetting the patch.
Paul
> :ADDPATCH fortran:
>
> This patch provides a diagnostic of standard violating code, which has:
>
> allocate (i, x(i)) or allocate (i, stat = i) ;
>
> ie. allocation of objects used in specification expressions or of the
> stat variable, within the same allocate statement. The bit of the
> patch that deals with the stat variable being allocated is straight
> forward; each new variable to be allocated has its symbol checked
> against the symbol for stat. If the two are the same, this is an
> error. The specification expressions are a bit more complicated; each
> symbol to be allocated is checked by a new recursive function against
> the symbols referenced in all the specification expressions in the
> allocate statement. The testcase combines those received from each
> reporter.
>
> Regtested on FC5/Athlon - OK for trunk and 4.1?
>
> Paul
>
> 2006-09-17 Paul Thomas <pault@gcc.gnu.org>
>
> PR fortran/20779
> PR fortran/20891
> * resolve.c (find_sym_in_expr): New function that returns true
> if a symbol is found in an expression.
> (resolve_allocate_expr): Check whether the STAT variable is
> itself allocated in the same statement. Use the call above to
> check whether any of the allocated arrays are used in array
> specifications in the same statement.
>
> 2006-09-17 Paul Thomas <pault@gcc.gnu.org>
>
> PR fortran/20779
> PR fortran/20891
> * gfortran.dg/alloc_alloc_expr_1.f90: New test.
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr20779.diff
Type: text/x-patch
Size: 6427 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060918/f17c93cd/attachment.bin>
More information about the Gcc-patches
mailing list