From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28522 invoked by alias); 4 Jan 2010 09:55:37 -0000 Received: (qmail 28483 invoked by uid 48); 4 Jan 2010 09:55:26 -0000 Date: Mon, 04 Jan 2010 09:55:00 -0000 Message-ID: <20100104095526.28482.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/42597] ICE with procedure pointer initialized to null() 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-01/txt/msg00361.txt.bz2 ------- Comment #1 from burnus at gcc dot gnu dot org 2010-01-04 09:55 ------- Confirmed. The initialization works - if in a procedure or program, but it fails in the declaration part of a module. The problem seems to be related to returning an array - one should not have called gfc_build_null_descriptor but via get_proc_pointer_decl the routine gfc_conv_initializer (with pointer = true and array = false). Actually, the following looks bogus: DECL_INITIAL (decl) = gfc_conv_initializer (sym->value, &sym->ts, TREE_TYPE (decl), sym->attr.dimension, sym->attr.proc_pointer); Namely, the last but one argument. I think, it should be: sym->attr.proc_pointer ? false : sym->attr.dimension But that does not explain why it seems to work elsewhere. Janus, what do you think? -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janus at gcc dot gnu dot org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |ice-on-valid-code Last reconfirmed|0000-00-00 00:00:00 |2010-01-04 09:55:26 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42597