[Patch, fortran, 64674, v1] [OOP] ICE in ASSOCIATE with class array
Andre Vehreschild
vehre@gmx.de
Mon May 4 14:53:00 GMT 2015
Hi all,
I like to present here a first patch for using class arrays in associate. Upto
now gfortran crashed, when a class array-section/element was selected in an
associate. This patch fixes this now for class array sections as well as for
single elements.
The story of the patch is told quite shortly:
- parse.c::parse_associate() needs to gather more information about what the
target is like. Previously the target's rank and array_spec was not computed,
which disallowed the use of further array refs in the associate body:
associate (vec => class_matrix(2:3, 2))
vec(1) = ... ! <- Unclassifiable statement, because no array_spec was
attached to vec. This is fixed by the second hunk of the patch.
- The third hunk in primary.c prevents setting the dimension attribute on a
class object's symbol.
- The hunks in resolve.c take care about adding dummy full array_refs and in
resolve_assoc_var correct the class type, when the target expression's rank
is 0. Previously the symbol would have an array valued type, when the
target's base type was array valued. But for a scalar target this needed some
polishing.
- Additionally a test was added.
Bootstraps and regtests ok on x86_64-linux-gnu/f21.
Ok for trunk?
Note, this patch was diffed from a trunk with my older patches for
PR65548, v3 https://gcc.gnu.org/ml/fortran/2015-04/msg00123.html and
PR44672, v5 https://gcc.gnu.org/ml/fortran/2015-04/msg00124.html
applied.
Regards,
Andre
--
Andre Vehreschild * Email: vehre ad gmx dot de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr64674_1.clog
Type: application/octet-stream
Size: 779 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150504/6a45ac50/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr64674_1.patch
Type: text/x-patch
Size: 12216 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150504/6a45ac50/attachment.bin>
More information about the Fortran
mailing list