[J3] [EXTERNAL] Should all intrinsic functions be simple?
Reuben D. Budiardja
reubendb at ornl.gov
Tue Dec 19 19:59:46 UTC 2023
On 12/19/23 11:04, Brad Richardson via J3 wrote:
<snipped>
However, that would not
> necessarily be true for all of the intrinsic functions. Take the
> following example:
>
> cur_team = get_team()
> ...
> change team (new_team)
> cur_team = get_team()
> ...
> end team
>
> Clearly, it is intended that the two calls to get_team return different
> results, so common subexpression elimination would not be valid here.
> Also, conceptually, it would not be possible to implement this call in
> a way that does "not contain a designator of a variable that is
> accessed by use or host association" or "not contain a reference to a
> variable in a common block" as it clearly must be accessing some global
> state of the program.
> Intrinsic functions which may be affected include:
>
> * failed_images
> * get_team
> * image_index
> * num_images
> * stopped_images
> * team_number
> * this_image
I think this is conflating what a compiler may need to do with the
actual program. From the program standpoint, the example above does not
violate any of the simple-ness constraints (or any of the listed
function). So I still think they are SIMPLE.
Best,
Reuben
More information about the J3
mailing list