diff options
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 463863dc381..b0173f7a5ce 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15407,6 +15407,7 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset, case DW_OP_swap: case DW_OP_rot: case DW_OP_abs: + case DW_OP_neg: case DW_OP_not: case DW_OP_plus_uconst: case DW_OP_skip: @@ -15543,7 +15544,6 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset, case DW_OP_minus: case DW_OP_mod: case DW_OP_mul: - case DW_OP_neg: case DW_OP_or: case DW_OP_plus: case DW_OP_shl: @@ -15571,7 +15571,7 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset, if (stack_usage == NULL) return false; - frame_offset += *stack_usage; + frame_offset_ += *stack_usage; break; } @@ -17806,7 +17806,7 @@ native_encode_initializer (tree init, unsigned char *array, int size) fieldsize = tree_to_shwi (DECL_SIZE_UNIT (field)); pos = int_byte_position (field); gcc_assert (pos + fieldsize <= size); - if (val + if (val && fieldsize != 0 && !native_encode_initializer (val, array + pos, fieldsize)) return false; } @@ -18621,15 +18621,16 @@ add_prototyped_attribute (dw_die_ref die, tree func_type) } /* Add an 'abstract_origin' attribute below a given DIE. The DIE is found - by looking in either the type declaration or object declaration - equate table. */ + by looking in the type declaration, the object declaration equate table or + the block mapping. */ static inline dw_die_ref add_abstract_origin_attribute (dw_die_ref die, tree origin) { dw_die_ref origin_die = NULL; - if (TREE_CODE (origin) != FUNCTION_DECL) + if (TREE_CODE (origin) != FUNCTION_DECL + && TREE_CODE (origin) != BLOCK) { /* We may have gotten separated from the block for the inlined function, if we're in an exception handler or some such; make @@ -18651,6 +18652,8 @@ add_abstract_origin_attribute (dw_die_ref die, tree origin) origin_die = lookup_decl_die (origin); else if (TYPE_P (origin)) origin_die = lookup_type_die (origin); + else if (TREE_CODE (origin) == BLOCK) + origin_die = BLOCK_DIE (origin); /* XXX: Functions that are never lowered don't always have correct block trees (in the case of java, they simply have no block tree, in some other @@ -19402,11 +19405,13 @@ gen_entry_point_die (tree decl, dw_die_ref context_die) static void retry_incomplete_types (void) { + set_early_dwarf s; int i; for (i = vec_safe_length (incomplete_types) - 1; i >= 0; i--) if (should_emit_struct_debug ((*incomplete_types)[i], DINFO_USAGE_DIR_USE)) gen_type_die ((*incomplete_types)[i], comp_unit_die ()); + vec_safe_truncate (incomplete_types, 0); } /* Determine what tag to use for a record type. */ @@ -21467,6 +21472,10 @@ gen_lexical_block_die (tree stmt, dw_die_ref context_die) BLOCK_DIE (stmt) = stmt_die; old_die = NULL; } + + tree origin = block_ultimate_origin (stmt); + if (origin != NULL_TREE && origin != stmt) + add_abstract_origin_attribute (stmt_die, origin); } if (old_die) @@ -27383,10 +27392,6 @@ dwarf2out_finish (const char *filename) resolve_addr (comp_unit_die ()); move_marked_base_types (); - /* Walk through the list of incomplete types again, trying once more to - emit full debugging info for them. */ - retry_incomplete_types (); - if (flag_eliminate_unused_debug_types) prune_unused_types (); @@ -27687,6 +27692,10 @@ dwarf2out_finish (const char *filename) static void dwarf2out_early_finish (void) { + /* Walk through the list of incomplete types again, trying once more to + emit full debugging info for them. */ + retry_incomplete_types (); + /* The point here is to flush out the limbo list so that it is empty and we don't need to stream it for LTO. */ flush_limbo_die_list (); |