------- Comment #9 from jv244 at cam dot ac dot uk  2010-02-21 14:11 -------
(In reply to comment #7)
> (In reply to comment #3)
> > This could be somewhat similar, I really wonder if this needs a temp:
> > 
> > TYPE T1
> >  INTEGER :: a(3)
> > END TYPE T1
> > TYPE(T1), POINTER :: x,y
> > ALLOCATE(x,y)
> > x%a=y%a
> > END
> 
> I think one needs a temporary, cf. the following code:
> 
> integer, pointer :: a(:),b(:)
> allocate(a(3))
> a = [1,2,3]
> b => a(3:1:-1)
> a = b
> print *, a
> end
> 
this is example is different, here a temp can not be avoided. It is different
in that a and b have the pointer attribute, while x%a and x%b do not have the
pointer attribute (only the parent structure). But still, the example in
comment #3 seems tricky enough to defer optimization if you as me.


-- 


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

Reply via email to