Bug 67202 - Fortran FE should load scalar pass-by-reference intent-in arguments at the beginning of a function
Summary: Fortran FE should load scalar pass-by-reference intent-in arguments at the be...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 6.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: https://gcc.gnu.org/ml/gcc-patches/20...
Keywords: missed-optimization, patch
Depends on:
Blocks: 36854
  Show dependency treegraph
 
Reported: 2015-08-13 09:54 UTC by Martin Liška
Modified: 2021-04-16 16:22 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-11-08 00:00:00


Attachments
Test case (264 bytes, text/plain)
2015-08-13 09:54 UTC, Martin Liška
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2015-08-13 09:54:02 UTC
Created attachment 36178 [details]
Test case

Hello.

PR is follow-up of PR67170, where PRE can't hoist out an argument which is passed by reference and is intent-in. In the situation it would be beneficial to load the argument at the very beginning and transfer all references of the argument to the load.

Please take a look at attached test case.

Thanks,
Martin
Comment 1 Dominique d'Humieres 2015-11-08 17:42:53 UTC
Is there an easy way to check than a scalar pass-by-reference intent-in argument has been loaded at the beginning of the function?
Comment 2 Thomas Koenig 2018-09-18 20:42:16 UTC
(In reply to Dominique d'Humieres from comment #1)
> Is there an easy way to check than a scalar pass-by-reference intent-in
> argument has been loaded at the beginning of the function?

Easiest to check the *.original dump.

If the code looks like

x (integer(kind=4) & restrict i, integer(kind=4) & restrict j)
{
  *j = *i;
}


then it hasn't been done.
Comment 3 Martin Liška 2020-01-07 08:31:32 UTC
@Thomas: Setting host to 67202 is probably a typo.
Comment 4 Thomas Koenig 2020-01-07 18:09:05 UTC
(In reply to Martin Liška from comment #3)
> @Thomas: Setting host to 67202 is probably a typo.

Definitely :-) Removing.