From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11187 invoked by alias); 22 Jun 2009 09:04:58 -0000 Received: (qmail 10776 invoked by uid 48); 22 Jun 2009 09:04:41 -0000 Date: Mon, 22 Jun 2009 09:04:00 -0000 Message-ID: <20090622090441.10775.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/39850] Too strict checking for procedures as actual argument In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "janus 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/msg01565.txt.bz2 ------- Comment #8 from janus at gcc dot gnu dot org 2009-06-22 09:04 ------- > pr39850.f90:12:0: internal compiler error: in gfc_typenode_for_spec, at > fortran/trans-types.c:995 Yeah, the same happens for the examples in PR37254. I didn't notice it before, since I changed the test case slightly in my commit. Here is a patch which fixes it: Index: gcc/fortran/interface.c =================================================================== --- gcc/fortran/interface.c (revision 148778) +++ gcc/fortran/interface.c (working copy) @@ -1407,9 +1407,14 @@ } if (formal->attr.function && !act_sym->attr.function) - gfc_add_function (&act_sym->attr, act_sym->name, &act_sym->declared_at); - - if (formal->attr.subroutine && !act_sym->attr.subroutine) + { + gfc_add_function (&act_sym->attr, act_sym->name, + &act_sym->declared_at); + if (act_sym->ts.type == BT_UNKNOWN + && gfc_set_default_type (act_sym, 1, act_sym->ns) == FAILURE) + return 0; + } + else if (formal->attr.subroutine && !act_sym->attr.subroutine) gfc_add_subroutine (&act_sym->attr, act_sym->name, &act_sym->declared_at); -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39850