[Patch, Fortran] PR37580 - Add pointer assignment checks
Tobias Burnus
burnus@net-b.de
Sat Sep 20 20:16:00 GMT 2008
Hi all,
at some point between 4.2 and 4.3 the parser was updated to accept
pointer(:) =>
While this is valid Fortran 2003, it is not supported internally
by gfortran. Thus one could produce wrong code or get ICEs.
Solution: Add some check in expr.c to rejects (:). I also added
some checks in preparation for the "lower-bound:" / bounds-remapping
support (cf. PR 37580 and PR 29785).
Has someone a better idea for the error messages? Allowed per
Fortran 2003 is:
R735 pointer-assignment-stmt
is data-pointer-object [ (bounds-spec-list) ] => data-target
or data-pointer-object (bounds-remapping-list ) => data-target
R737 bounds-spec is lower-bound-expr :
R738 bounds-remapping is lower-bound-expr : upper-bound-expr
Build and regtested on x86-64-linux.
OK for the trunk and for 4.3 (after the usual delay)?
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pointer-remap.diff
Type: text/x-patch
Size: 2592 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080920/4c07087b/attachment.bin>
More information about the Gcc-patches
mailing list