From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26783 invoked by alias); 12 Jan 2011 21:00:00 -0000 Received: (qmail 26774 invoked by uid 22791); 12 Jan 2011 20:59:59 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Jan 2011 20:59:54 +0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47240] [F03] segfault with procedure pointer component X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: janus at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 12 Jan 2011 21:21:00 -0000 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: 2011-01/txt/msg01197.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47240 --- Comment #10 from Dominique d'Humieres 2011-01-12 20:59:31 UTC --- > sorry, I can not reproduce this at r168655 (plus patch from comment #7), at > least not on x86_64-unknown-linux-gnu. Do you only get this error with the > patch, or also with a clean trunk? I would expect that my patch should not have > any impact on your test case ... I am rebuilding a clean tree with only the following patch diff -up ../_clean/gcc/fortran/resolve.c gcc/fortran/resolve.c --- ../_clean/gcc/fortran/resolve.c 2011-01-09 22:13:56.000000000 +0100 +++ gcc/fortran/resolve.c 2011-01-12 21:49:39.000000000 +0100 @@ -4858,6 +4858,9 @@ expression_rank (gfc_expr *e) for (ref = e->ref; ref; ref = ref->next) { + if (ref->type == REF_COMPONENT && !ref->next) + rank = ref->u.c.component->as ? ref->u.c.component->as->rank : 0; + if (ref->type != REF_ARRAY) continue; diff -up ../_clean/gcc/fortran/trans-expr.c gcc/fortran/trans-expr.c --- ../_clean/gcc/fortran/trans-expr.c 2011-01-08 20:18:07.000000000 +0100 +++ gcc/fortran/trans-expr.c 2011-01-12 21:49:39.000000000 +0100 @@ -3044,7 +3044,8 @@ gfc_conv_procedure_call (gfc_se * se, gf || (fsym->attr.proc_pointer && !(e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.dummy)) - || (e->expr_type == EXPR_VARIABLE + || (fsym->attr.proc_pointer + && e->expr_type == EXPR_VARIABLE && gfc_is_proc_ptr_comp (e, NULL)) || fsym->attr.allocatable)) { (your patch for trans-expr.c does not apply cleanly with a copy&past from safari, so I hope I got it right).