https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79255

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, what I see is:
#0  add_AT_unsigned (die=0x7fffedd374b0, attr_kind=DW_AT_inline,
unsigned_val=2) at ../../gcc/dwarf2out.c:4150
#1  0x0000000000ea5d65 in gen_subprogram_die (decl=0x7fffee138600,
context_die=0x0) at ../../gcc/dwarf2out.c:22117
#2  0x0000000000eaf43e in gen_decl_die (decl=0x7fffee138600, origin=0x0,
ctx=0x0, context_die=0x0) at ../../gcc/dwarf2out.c:25284
#3  0x0000000000eb08d5 in dwarf2out_decl (decl=0x7fffee138600) at
../../gcc/dwarf2out.c:25793
#4  0x0000000000ea4d08 in dwarf2out_abstract_function (decl=0x7fffee138600) at
../../gcc/dwarf2out.c:21656
#5  0x0000000000eaf248 in gen_decl_die (decl=0x0, origin=0x7fffee138600,
ctx=0x0, context_die=0x7fffecb246e0) at ../../gcc/dwarf2out.c:25241
#6  0x0000000000eadd68 in process_scope_var (stmt=0x7fffeddf3480, decl=0x0,
origin=0x7fffee138600, context_die=0x7fffecb246e0)
    at ../../gcc/dwarf2out.c:24833
#7  0x0000000000eadec7 in decls_for_scope (stmt=0x7fffeddf3480,
context_die=0x7fffecb246e0) at ../../gcc/dwarf2out.c:24865
#8  0x0000000000ea9212 in gen_lexical_block_die (stmt=0x7fffeddf3480,
context_die=0x7fffecb245a0) at ../../gcc/dwarf2out.c:23207
#9  0x0000000000eada71 in gen_block_die (stmt=0x7fffeddf3480,
context_die=0x7fffecb245a0) at ../../gcc/dwarf2out.c:24795
#10 0x0000000000eadf13 in decls_for_scope (stmt=0x7fffeddf33c0,
context_die=0x7fffecb245a0) at ../../gcc/dwarf2out.c:24876
#11 0x0000000000ea93b7 in gen_inlined_subroutine_die (stmt=0x7fffeddf33c0,
context_die=0x7fffedd34000) at ../../gcc/dwarf2out.c:23245
#12 0x0000000000eada5c in gen_block_die (stmt=0x7fffeddf33c0,
context_die=0x7fffedd34000) at ../../gcc/dwarf2out.c:24792
#13 0x0000000000eadf13 in decls_for_scope (stmt=0x7fffee11cf00,
context_die=0x7fffedd34000) at ../../gcc/dwarf2out.c:24876
#14 0x0000000000eada86 in gen_block_die (stmt=0x7fffee11cf00,
context_die=0x7fffedd34000) at ../../gcc/dwarf2out.c:24798
#15 0x0000000000eadf13 in decls_for_scope (stmt=0x7fffee11ce40,
context_die=0x7fffedd34000) at ../../gcc/dwarf2out.c:24876
#16 0x0000000000ea6b1a in gen_subprogram_die (decl=0x7fffee2f8600,
context_die=0x7fffefcf3000) at ../../gcc/dwarf2out.c:22441
#17 0x0000000000eaf43e in gen_decl_die (decl=0x7fffee2f8600, origin=0x0,
ctx=0x0, context_die=0x7fffefcf3000) at ../../gcc/dwarf2out.c:25284
#18 0x0000000000eb08d5 in dwarf2out_decl (decl=0x7fffee2f8600) at
../../gcc/dwarf2out.c:25793
#19 0x0000000000eb0934 in dwarf2out_function_decl (decl=0x7fffee2f8600) at
../../gcc/dwarf2out.c:25808
#20 0x0000000000f401e7 in rest_of_handle_final () at ../../gcc/final.c:4520

It doesn't seem to me that
exp_ch5__expand_assign_with_target_names__replace_target_name
(the innermost decl) is actually inlined, the reason it is
dwarf2out_abstract_function is that it is present in some other inline
function's BLOCK_NONLOCALIZED_VARS and for those we do:
      if (! early_dwarf)
        for (i = 0; i < BLOCK_NUM_NONLOCALIZED_VARS (stmt); i++)
          process_scope_var (stmt, NULL, BLOCK_NONLOCALIZED_VAR (stmt, i),
                             context_die);
I wonder if we shouldn't do:
--- gcc/dwarf2out.c.jj  2017-03-22 17:51:56.000000000 +0100
+++ gcc/dwarf2out.c     2017-03-23 17:31:45.225862154 +0100
@@ -24861,8 +24861,13 @@ decls_for_scope (tree stmt, dw_die_ref c
         if we've done it once already.  */
       if (! early_dwarf)
        for (i = 0; i < BLOCK_NUM_NONLOCALIZED_VARS (stmt); i++)
-         process_scope_var (stmt, NULL, BLOCK_NONLOCALIZED_VAR (stmt, i),
-                            context_die);
+         {
+           decl = BLOCK_NONLOCALIZED_VAR (stmt, i);
+           if (TREE_CODE (decl) == FUNCTION_DECL)
+             process_scope_var (stmt, decl, NULL_TREE, context_die);
+           else
+             process_scope_var (stmt, NULL_TREE, decl, context_die);
+         }
     }

   /* Even if we're at -g1, we need to process the subblocks in order to get
which fixes the ICE, because then we really abstract only actually inlined
functions (those appearing in BLOCK_ABSTRACT_ORIGIN).

Reply via email to