Hi Tobias,
If one passes something which is not a variable as an argument, there is
no point to do the copy-out – the copy-in is sufficient. Note that a the
result of a pointer-returning function is regarded as variable.
As cleanup, I also fixed the indentation (twice) and the pointless 'fsym
?' check inside a condition body where the condition already checks this.
Build on x86-64-gnu-linux.
OK for the trunk – and for GCC 9? [It's a 9/10 regression]
The change to avoid the copy-out via INTENT(IN) makes sense.
If you add this, it would be good to add a test (for example counting
while statements in the *.original dump) that the copyback does not
happen.
Generally, if we are passing an expression, the call to
gfc_conv_subref_array_arg is not needed - we will generate an array
temporary for the expression anyway, and this will always be contiguous.
Regards
Thomas