Re: [Patch, Fortran] PR91640 – Fix call to contiguous dummy

Tobias Burnus burnus@net-b.de
Fri Jan 3 19:44:00 GMT 2020


Hi Thomas,

On 1/3/20 7:18 PM, Thomas König wrote:

>> Build on x86-64-gnu-linux.
>> OK for the trunk – and for GCC 9? [It's a 9/10 regression]
Is is now okay?
> 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.

I have now added something, which hopefully correctly captures this. I 
added 'xxx' to have some example how a copy out could look like. (That 
way, I also test whether a copy out happens.)

That creating a well-working pattern is difficult as get_var() also uses 
atmp. – However, looking at the dump, I found that the copy out will 
call get_var again! That's now PR 93148.

> 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.

True – but one needs to call some function. Whether 
gfc_conv_subref_array_arg with INTENT_IN or gfc_conv_array_parameter 
does not matter.

As a variant, I now use the latter (via the else branch). Either variant 
produces the same original tree. One can argue which variant is clearer; 
I think both are fine – pick one.

Tobias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: contiguous-v2.diff
Type: text/x-patch
Size: 4633 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20200103/41cdc6df/attachment.bin>


More information about the Gcc-patches mailing list