[Patch, Fortran] PR52059 - Scalarizing fix - only add array ref to a variable

Mikael Morin mikael.morin@sfr.fr
Wed Feb 1 11:59:00 GMT 2012


On 31.01.2012 23:22, Tobias Burnus wrote:
> Dear all,
>
> I have no idea about the scalarizer, but the attached patch fixes the
> test case and somehow adding an array ref to a scalar looks odd to me ...
>
??
The condition is about an array without array ref, isn't it?
We can't access the "array" part of the "data" union without checking 
before that it is an array.

To be clear the added if branch is there to catch temporaries created by 
the trans-stmt.c part of the regressing patch.  Those had no array ref, 
but gfc_conv_variable (they are temporaries for variables) expects one.
I thought I would have to revert the trans-expr.c part and try to detect 
temporaries somewhere else, but it seems your patch would do just fine.

> (Before the regression-causing patch, only the "else" branch existed.)
>
> Build and regtested on x86-64-linux.
> OK for the trunk?
>
OK, and thanks for it.

Mikael

PS: gfc_conv_derived_to_class has only the "else" branch, but has to 
handle elementals too; I wouldn't be surprised if there was a problem 
with it.



More information about the Fortran mailing list