From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11976 invoked by alias); 28 Jun 2009 20:31:59 -0000 Received: (qmail 11904 invoked by uid 48); 28 Jun 2009 20:31:47 -0000 Date: Sun, 28 Jun 2009 20:31:00 -0000 Message-ID: <20090628203147.11903.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/40551] Wrong code due to missing copy-in/copy-out stried array to assumed-size dummy In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pault 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: 2009-06/txt/msg02038.txt.bz2 ------- Comment #6 from pault at gcc dot gnu dot org 2009-06-28 20:31 ------- (In reply to comment #5) The following fixes the problem. It needs to be checked to see if it is over-restrictive. Index: gcc/fortran/trans-expr.c =================================================================== --- gcc/fortran/trans-expr.c (revision 149003) +++ gcc/fortran/trans-expr.c (working copy) @@ -4818,7 +4823,8 @@ tree tmp; /* Special case a single function returning an array. */ - if (expr2->expr_type == EXPR_FUNCTION && expr2->rank > 0) + if (expr2->expr_type == EXPR_FUNCTION && expr2->rank > 0 + && !(expr1->ref && !gfc_full_array_ref_p (expr1->ref))) { tmp = gfc_trans_arrayfunc_assign (expr1, expr2); if (tmp) Cheers Paul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40551