This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: Parentheses expressions as actual arguments of elemental procedures


Hi all,

Paul Richard Thomas wrote:
Maybe you have done this already on #gfortran - could you get together
to discuss how to attack the problem in the title line.  Mikael, you
obviously are well into the scalarizer and would be able to help here
- these actual arguments need to be written to a temporary array.  At
present, the scalarizer treats them to a temporary scalar, element by
element.  Daniel, I don't know if you have noted this but the problem
is not restricted to subroutines and is, in fact, a scalarizer bug.

no, so far we've not discussed this between ourselves... And shame on me it took me so long to post my promised comments on this problem :$


As far as I understand the scalarizer (and that's not very far) there's some "context" to hold "scalarized expressions" for base-expressions; when looking into trans-stmt.c:gfc_conv_elemental_dependencies, for each expression that should get a temporary there, it is looked up in this linked list. So I guess when the scalarizer translates an expression, it will see if there's already a temporary or such for it in this linked list (ss->expr or so?). So far as I've seen, this is only done for EXPR_VARIABLE expressions, though. Would it be possible to do the same thing for other expressions as well? I tried this with gfc_conv_elemental_dependencies, but those expressions were not in this linked list and could not be found. Is it possible to simply add them there (when the ss/se/context/whatever is created?) or would this break something?

Another idea would be to take up my ideas for front-end temporaries again (that would be useful for finalization, too), see http://gcc.gnu.org/ml/fortran/2008-08/msg00026.html. Then we could use this feature to generate all temporaries for actual argument expressions in ELEMENTAL calls on the higher level.

That's my ideas, and I would like to hear your opinions on them and comments from someone better into the scalarizer about point 1...

Yours,
Daniel

--
Done:  Arc-Bar-Cav-Rog-Sam-Val-Wiz
To go: Hea-Kni-Mon-Pri-Ran-Tou


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