------- Comment #16 from burnus at gcc dot gnu dot org  2010-07-09 12:26 -------
(In reply to comment #13)
> What about

>   dudx = ddx(u(:,:,2))

>   real function ddx(array)
>     real, dimension(:,:) :: array
>     call bar(u)
>     ddx = array(1,1)

> AFAICS, this is legal and would require a temporary.

I don't see why: You never have the same variable on the LHS and on the RHS. On
the LHS is "dudx" == "ddx" while on the RHS is "u" == "array". As I cannot see
how "u" and "dudx" can alias, I don't think one needs any temporary. 

Not even in any function call as the dummies are non-CONTIGUOUS assumed-shape
arrays. (Otherwise, a temporary is needed as the actual argument is not simple
contiguous [actually: it is known not to be contiguous].)

The result 3.0 looks also fine and all my compiles produce it.


> Note also that it "fixes" pr44744.

Nevertheless, one should leave the PR open as the bounds checking is obviously
missing. (Though, one should change the title after committal.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44773

Reply via email to