From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21284 invoked by alias); 7 Sep 2003 05:10:58 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21266 invoked by alias); 7 Sep 2003 05:10:58 -0000 Date: Sun, 07 Sep 2003 05:10:00 -0000 Message-ID: <20030907051058.21265.qmail@sources.redhat.com> From: "aoliva at redhat dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20030715020651.11522.snyder@fnal.gov> References: <20030715020651.11522.snyder@fnal.gov> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/11522] [3.3/3.4 Regression] g77 dwarf-2 ICE in add_abstract_origin_attribute X-Bugzilla-Reason: CC X-SW-Source: 2003-09/txt/msg00566.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11522 ------- Additional Comments From aoliva at redhat dot com 2003-09-07 05:10 ------- Subject: Re: [3.3/3.4 Regression] g77 dwarf-2 ICE in add_abstract_origin_attribute On Sep 5, 2003, "mmitchel at gcc dot gnu dot org" wrote: > This bug was caused by Alexandre's change. This patch fixes it. Without it, we end up attempting to emit a die for the inlined copy of a function declaration, and then, erhm, die :-) because the die for the original declaration wasn't emitted. It seems that, with tree inlining, we always end up emitting the abstract decl for the inlined function before we get to that point, so the buggy case never hit. Ok to install? Index: gcc/ChangeLog from Alexandre Oliva PR fortran/11522 * dwarf2out.c (gen_inlined_subroutine_die): Emit abstract function for ultimate origin even if block is abstract. Index: gcc/dwarf2out.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v retrieving revision 1.390.2.8 diff -u -p -r1.390.2.8 dwarf2out.c --- gcc/dwarf2out.c 20 Jul 2003 07:22:55 -0000 1.390.2.8 +++ gcc/dwarf2out.c 7 Sep 2003 05:01:42 -0000 @@ -11051,15 +11051,19 @@ gen_inlined_subroutine_die (stmt, contex dw_die_ref context_die; int depth; { + tree decl = block_ultimate_origin (stmt); + + /* Emit info for the abstract instance first, if we haven't yet. We + must emit this even if the block is abstract, otherwise when we + emit the block below (or elsewhere), we may end up trying to emit + a die whose origin die hasn't been emitted, and crashing. */ + dwarf2out_abstract_function (decl); + if (! BLOCK_ABSTRACT (stmt)) { dw_die_ref subr_die = new_die (DW_TAG_inlined_subroutine, context_die, stmt); - tree decl = block_ultimate_origin (stmt); char label[MAX_ARTIFICIAL_LABEL_BYTES]; - - /* Emit info for the abstract instance first, if we haven't yet. */ - dwarf2out_abstract_function (decl); add_abstract_origin_attribute (subr_die, decl); ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL, -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org} CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist Professional serial bug killer