diff options
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 60 |
1 files changed, 47 insertions, 13 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c0f93d763f5..845786b96d2 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -263,7 +263,6 @@ static GTY(()) int dw2_string_counter; static GTY(()) bool have_multiple_function_sections = false; /* Whether the default text and cold text sections have been used at all. */ - static GTY(()) bool text_section_used = false; static GTY(()) bool cold_text_section_used = false; @@ -285,6 +284,9 @@ static void dwarf2out_note_section_used (void); personality CFI. */ static GTY(()) rtx current_unit_personality; +/* Whether an eh_frame section is required. */ +static GTY(()) bool do_eh_frame = false; + /* .debug_rnglists next index. */ static unsigned int rnglist_idx; @@ -1063,10 +1065,14 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, dup_label = xstrdup (label); current_function_func_begin_label = dup_label; - /* We can elide the fde allocation if we're not emitting debug info. */ + /* We can elide FDE allocation if we're not emitting frame unwind info. */ if (!do_frame) return; + /* Unlike the debug version, the EH version of frame unwind info is a per- + function setting so we need to record whether we need it for the unit. */ + do_eh_frame |= dwarf2out_do_eh_frame (); + /* Cater to the various TARGET_ASM_OUTPUT_MI_THUNK implementations that emit insns as rtx but bypass the bulk of rest_of_compilation, which would include pass_dwarf2_frame. If we've not created the FDE yet, @@ -1183,8 +1189,7 @@ dwarf2out_frame_finish (void) output_call_frame_info (0); /* Output another copy for the unwinder. */ - if ((flag_unwind_tables || flag_exceptions) - && targetm_common.except_unwind_info (&global_options) == UI_DWARF2) + if (do_eh_frame) output_call_frame_info (1); } @@ -12496,7 +12501,8 @@ modified_type_die (tree type, int cv_quals, bool reverse, dw_die_ref mod_scope; /* Only these cv-qualifiers are currently handled. */ const int cv_qual_mask = (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE - | TYPE_QUAL_RESTRICT | TYPE_QUAL_ATOMIC); + | TYPE_QUAL_RESTRICT | TYPE_QUAL_ATOMIC | + ENCODE_QUAL_ADDR_SPACE(~0U)); const bool reverse_base_type = need_endianity_attribute_p (reverse) && is_base_type (type); @@ -13859,10 +13865,14 @@ const_ok_for_output_1 (rtx rtl) We should really identify / validate expressions enclosed in CONST that can be handled by assemblers on various targets and only handle legitimate cases here. */ - if (GET_CODE (rtl) != SYMBOL_REF) + switch (GET_CODE (rtl)) { - if (GET_CODE (rtl) == NOT) - return false; + case SYMBOL_REF: + break; + case NOT: + case NEG: + return false; + default: return true; } @@ -15037,8 +15047,32 @@ mem_loc_descriptor (rtx rtl, machine_mode mode, if (!const_ok_for_output (rtl)) { if (GET_CODE (rtl) == CONST) - mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), int_mode, - mem_mode, initialized); + switch (GET_CODE (XEXP (rtl, 0))) + { + case NOT: + op = DW_OP_not; + goto try_const_unop; + case NEG: + op = DW_OP_neg; + goto try_const_unop; + try_const_unop: + rtx arg; + arg = XEXP (XEXP (rtl, 0), 0); + if (!CONSTANT_P (arg)) + arg = gen_rtx_CONST (int_mode, arg); + op0 = mem_loc_descriptor (arg, int_mode, mem_mode, + initialized); + if (op0) + { + mem_loc_result = op0; + add_loc_descr (&mem_loc_result, new_loc_descr (op, 0, 0)); + } + break; + default: + mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), int_mode, + mem_mode, initialized); + break; + } break; } @@ -20815,7 +20849,7 @@ add_type_attribute (dw_die_ref object_die, tree type, int cv_quals, return; type_die = modified_type_die (type, - cv_quals | TYPE_QUALS_NO_ADDR_SPACE (type), + cv_quals | TYPE_QUALS (type), reverse, context_die); @@ -23481,6 +23515,7 @@ gen_producer_string (void) case OPT_fltrans_output_list_: case OPT_fresolution_: case OPT_fdebug_prefix_map_: + case OPT_fcompare_debug: /* Ignore these. */ continue; default: @@ -27600,8 +27635,7 @@ dwarf2out_assembly_start (void) if (HAVE_GAS_CFI_SECTIONS_DIRECTIVE && dwarf2out_do_cfi_asm () - && (!(flag_unwind_tables || flag_exceptions) - || targetm_common.except_unwind_info (&global_options) != UI_DWARF2)) + && !dwarf2out_do_eh_frame ()) fprintf (asm_out_file, "\t.cfi_sections\t.debug_frame\n"); } |