OOP on fortran-dev branch
Janus Weil
janus@gcc.gnu.org
Sun Sep 20 11:56:00 GMT 2009
Hi all,
here is an update of the OOP patch with many new fixes. It should
handle the most common cases of CLASS pointer assignments now (see
attached test case). Some CLASS allocate statements will also work
(e.g. class_1.f03), but probably not all cases yet. The patch also
behaves a bit better on Salvatore's code, but one still gets an ICE at
some point (in psb_mat_mod.f03).
The question is how to go on: Should I just commit this to the branch
now, or rather wait until trunk is a reasonable state again?
>> But I also made some modifications on Paul's
>> 'gfc_add_class_..._reference' functions, which I think did not quite
>> do the right thing. In particular I merged both into one function,
>> which I called 'gfc_add_component_ref'. Paul, could you have a look at
>> this, and make sure it is correct?
>
> I do not think that it is. In particular, you must not stick the
> component reference after the final array reference, when the class
> object has non-zero rank. Your 'while' loop will have to stop when
> the next reference is an array reference with the array-spec of the
> class object.... if you see what I mean!
I see. That means that in general one can neither just insert the new
reference at the end, nor at the beginning. I hope the present
implementation is reasonable (at least it works for my class pointer
assignment examples, and some class allocate statements).
Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oop0920.diff
Type: text/x-diff
Size: 50989 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090920/88ae8630/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: class_pointer_assign.f90
Type: application/octet-stream
Size: 326 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090920/88ae8630/attachment.obj>
More information about the Gcc-patches
mailing list