[Patch, Fortran] PR 44207: ICE with ALLOCATABLE components and SOURCE

Janus Weil janus@gcc.gnu.org
Fri Jun 11 01:54:00 GMT 2010


Hi Steve,

>> Btw, both 'conformable_arrays' and 'compare_shapes' were implemented
>> by Steve (the first in r151023, the second in r95945), so maybe he can
>> give some advice here?
>>
>
> Well, r95945 is more than 5 years ago while r151023 is
> almost a year old.  I can't recall the details but reading
> the diffs
>
> svn diff -r 95944:95945 . | more
> svn diff -r 151022:151023 . | more
>
> shows that compare_shapes(*op1, *op2) is only called if
> it is known the op1->rank == op2->rank.  Additionally,
> this function assumes the arrays op1->shape[] and op2->shape[]
> are already populated with the extent of each dimension.
>
> For conformable_arrays(*e1, *e2), the ranks of the expression
> may be different (which is the first check within the function).
> In additional, if the ranks match, this function computes the
> extent for e2.  Here, e1->shape[] is already propulated.

thanks for your comments. I think the fact that e2->rank and e2->shape
are not set is just to do the funny treatment of the ALLOCATE
expression with an AR_ELEMENT reference. Not sure if it would be worth
to get in there and change this ...


>> > For a start, I wanted to get conformable_arrays fixed. One could still
>> > think about merging them afterwards.
>>
>> Due to the complications described above it is not trivial to merge
>> both functions, and I would prefer to just fix the ICE with the patch
>> I proposed earlier in this thread. Is that ok?
>
> As far as I'm concerned, "Yes, let's fix the ICE".

Alright. I'm taking this as an ok and have committed the patch as r160589.

Cheers,
Janus



More information about the Fortran mailing list