From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4275 invoked by alias); 28 Feb 2008 10:43:37 -0000 Received: (qmail 3949 invoked by uid 48); 28 Feb 2008 10:42:54 -0000 Date: Thu, 28 Feb 2008 10:43:00 -0000 Message-ID: <20080228104254.3948.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/34868] ICE with -ff2c for function returning a complex number In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fxcoudert 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: 2008-02/txt/msg02908.txt.bz2 ------- Comment #9 from fxcoudert at gcc dot gnu dot org 2008-02-28 10:42 ------- (In reply to comment #8) > There's more to it... using the "result" syntax for the function makes it fail > even with my patch That's because the result symbol is not marked with attr.always_explicit, only the procedure symbol. I think it's more convenient to mark both: Index: resolve.c =================================================================== --- resolve.c (revision 132611) +++ resolve.c (working copy) @@ -106,7 +106,10 @@ resolve_formal_arglist (gfc_symbol *proc if (gfc_elemental (proc) || sym->attr.pointer || sym->attr.allocatable || (sym->as && sym->as->rank > 0)) - proc->attr.always_explicit = 1; + { + proc->attr.always_explicit = 1; + sym->attr.always_explicit = 1; + } formal_arg_flag = 1; @@ -187,7 +190,11 @@ resolve_formal_arglist (gfc_symbol *proc if ((sym->as && sym->as->rank > 0 && sym->as->type == AS_ASSUMED_SHAPE) || sym->attr.pointer || sym->attr.allocatable || sym->attr.target || sym->attr.optional) - proc->attr.always_explicit = 1; + { + proc->attr.always_explicit = 1; + if (proc->result) + proc->result->attr.always_explicit = 1; + } /* If the flavor is unknown at this point, it has to be a variable. A procedure specification would have already set the type. */ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34868