Re: C_F_POINTER, aliasing and performance



Jugoslav Dujic <jdujic@xxxxxxxxx> wrote:

Note that copy-in/copy-out, in practice, can occur only with assumed-size
dummies

and explicit shape. That is a very important case, as much f77 code uses
it. In fact, all f77 code uses either explicit shape or assumed size,
those being the only two options then. That's even one way to remember
the rule; it is no coincidence.

(while compiler, in theory, might be smart enough to employ it
with assumed-shape if it's more efficient, I doubt any does it, so let's
put that aside).

Yes, there exist compilers that can do copy for assumed shape. The NAG
compiler has done so for ages, for example. However, it tends to be
controlled by a user-specified switch, rather than having the compiler
try to figure out when it might be beneficial.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: Passing an array section
    ... I guess what happen is, since the array is declared of explicit shape, ... the address of the first element of the section get passed to the ... The standard says that the code is valid (well, ... and that it is up to the compiler to make it work. ...
    (comp.lang.fortran)
  • Re: Passing an array section
    ... I guess what happen is, since the array is declared of explicit shape, ... the address of the first element of the section get passed to the ... The standard says that the code is valid (well, ... and that it is up to the compiler to make it work. ...
    (comp.lang.fortran)