re PR fortran/11522 (g77 dwarf-2 ICE in add_abstract_origin_attribute)
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 11 Sep 2003 13:41:56 +0000 (13:41 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 11 Sep 2003 13:41:56 +0000 (13:41 +0000)
PR fortran/11522
* dwarf2out.c (gen_inlined_subroutine_die): Emit abstract function
for ultimate origin even if block is abstract.

From-SVN: r71301

gcc/ChangeLog
gcc/dwarf2out.c

index be4c46b5b63dcaf9ebbbe8ef4d151a9a1c60b20c..0c7f82b405c6e3214f11d9cc88f4b723d798722f 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-11  Alexandre Oliva  <aoliva@redhat.com>
+
+       PR fortran/11522
+       * dwarf2out.c (gen_inlined_subroutine_die): Emit abstract function
+       for ultimate origin even if block is abstract.
+
 2003-09-11  Roger Sayle  <roger@eyesopen.com>
 
        * combine.c (combine_simplify_rtx): Move several NOT and NEG
index eac43ac77d314f47da7f2d78862f8fea5d686ba3..5fa730e1b55c5f0fe5c3ad66439e3f35219bc31d 100644 (file)
@@ -10990,16 +10990,20 @@ gen_lexical_block_die (tree stmt, dw_die_ref context_die, int depth)
 static void
 gen_inlined_subroutine_die (tree stmt, 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,
                                   BLOCK_NUMBER (stmt));