From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1166 invoked by alias); 16 Jul 2010 14:47:19 -0000 Received: (qmail 1107 invoked by uid 48); 16 Jul 2010 14:47:06 -0000 Date: Fri, 16 Jul 2010 14:47:00 -0000 Message-ID: <20100716144706.1106.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/44945] [4.6 Regression] Wrong decl for module vars / FAIL: gfortran.dg/char_array_structure_constructor.f90 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/msg01713.txt.bz2 ------- Comment #18 from burnus at gcc dot gnu dot org 2010-07-16 14:47 ------- Answer: With the patch, one gets: gfortran -fwhole-file gfortran.dg/default_initialization_4.f90 without the patch (and still -fwhole-file) it works. The reason is that one does not "copy" over the backend_decl for the components - which one might need to do recursively as the components might again be derived types. Thus, it fails at trans-expr.c's gfc_conv_component_ref for: gcc_assert (c->backend_decl). Actually, I do not quite understand why BT_CLASS works - the BT_DERIVED check of comment 13 should be also false for BT_CLASS, which means its backend_decl should already be imported with -fwhole-file. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44945