This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]