From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13957 invoked by alias); 19 Feb 2010 21:21:07 -0000 Received: (qmail 13902 invoked by uid 48); 19 Feb 2010 21:20:52 -0000 Date: Fri, 19 Feb 2010 21:21:00 -0000 Message-ID: <20100219212052.13901.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/36933] unneeded temporary with derived type containing an array as argument In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg01978.txt.bz2 ------- Comment #7 from burnus at gcc dot gnu dot org 2010-02-19 21:20 ------- (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 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36933