[Patch, Fortran] PR 43362 - PURE contraint - fix ICE, add missing check

Jerry DeLisle jvdelisle@verizon.net
Sun Mar 14 13:33:00 GMT 2010


Tobias Burnus wrote:
> Found when adding the equivalent check for coarrays. There are two
> issues, one NULL pointer access for a valid case (item (4) does not
> apply) as accessing "rhs->symtree->n.sym"  causes a segfault if RHS is
> not an EXPR_VARIABLE but, e.g., a structure constructor.
> 
> The other issue is that gfortran did not have a check for constraint (3).
> 
> Quoting Fortran 2003:
> 
> "C1272 In a pure subprogram any designator with a base object that is in
> common or accessed by host or use association, is a dummy argument of a
> pure function, is a dummy argument with INTENT (IN) of a pure
> subroutine, or an object that is storage associated with any such
> variable, shall not be used in the following contexts:
> [...]
> (3) As the expr corresponding to a component with the POINTER attribute
> in a structure constructor.
> (4) As the expr of an intrinsic assignment statement in which the
> variable is of a derived type if the derived type has a pointer
> component at any level of component selection; [...]"
> 
> Build and regtested on x86-64-linux.
> OK for the trunk?
> 
> Tobias
> 
OK, thanks

Jerry



More information about the Gcc-patches mailing list