From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19409 invoked by alias); 29 Jul 2010 14:44:34 -0000 Received: (qmail 19350 invoked by uid 48); 29 Jul 2010 14:44:16 -0000 Date: Thu, 29 Jul 2010 14:44:00 -0000 Message-ID: <20100729144416.19349.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/45128] Segmentation fault with -fwhole-file for subref_array_pointer 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-07/txt/msg03223.txt.bz2 ------- Comment #1 from burnus at gcc dot gnu dot org 2010-07-29 14:44 ------- Carry over the comment from PR 45125, where I had posted it initially (and accidentally). The segfault occurs for: l.4768 gfc_add_modify (&lse.post, GFC_DECL_SPAN(decl), tmp); It seems as if GFC_DECL_SPAN(decl) access a NULL pointer. That's decl->decl_common.lang_specific->span where lang_specific == NULL. While the dump has: tf_ad_splitting_driver_plane () { extern integer(kind=8) span.0 = 0; [...] span.0 = 4; the "span" variable does not really exist globally but is only created when needed, cf. http://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/fortran/trans-decl.c;hb=HEAD#l1243 gfc_get_symbol_decl: 1243 else if (sym->attr.subref_array_pointer) 1245 /* We need the span for these beasts. */ 1246 gfc_allocate_lang_decl (decl); 1249 if (sym->attr.subref_array_pointer) 1261 GFC_DECL_SPAN (decl) = span; If one now recycles the definition for the array descriptor "desc" this information is not present. I think the real solution is the new array descriptor. I do not know how to fix this otherwise - except by always generating a span variable. Paul - any progress from the array-descriptor front? -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pault 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-07-29 14:44:16 date| | Summary|Segmentation fault with - |Segmentation fault with - |fwhole-file |fwhole-file for | |subref_array_pointer http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45128