Permit implicit reshaping in get_callee()#3442
Conversation
|
@sergisiso This probably looks like it'd be best for you to review (as you may know more about if/why we may not support this at current). If I'm wrong and you're too busy then let me know and I'm also happy to have a look. I'm not sure if/how this could affect inlining (if it would at all, but inlining functions with this behaviour would be bad)? |
Exactly - this functionality was (I think) driven by the inlining use case and therefore I think that's the reason I wrote it this way. If it would be useful to have the option to permit re-shaped arguments then I don't have a problem with that, as long as it can still be refused when trying to inline. |
|
Hi @arporter and @LonelyCat124, I believe that Indeed, this feels like a much better place for the rank check. I noticed it because I had to tweak one of the inlining tests (see "Files Changed") which, after my proposed change, hits a different (and clearer) error message about Can you think of any other blockers for this PR? Unfortunately, implicit reshaping does crop up in important places in UKCA, and PSyclone not resolving the call is blocking some of my analyses. Edit: I may be able to update UKCA to avoid implicit reshaping in some places, but I am still thinking that the PR could be an improvement -- it is just allowing something that Fortran allows. |
|
Sorry for not replying earlier, in short I do agree this is an improvement specially if it unblocks work on UKCA. I got distracted because I was considering:
But none of these need to be fixed now for this PR to progress. |
Currently,
get_callee()requires the ranks of an array argument to match at the caller and callee but this is not strictly necessary in Fortran due to implicit reshaping (which occurs in UKCA). This PR requires the ranks to match only if:GenericInterfaceSymbolrather than aRoutineSymbol, orI appreciate that implicit reshaping may not be considered good practice - perhaps it is a deliberate decision to ignore it? If not, perhaps this PR is useful.