summaryrefslogtreecommitdiff
path: root/gcc/dwarf2cfi.c
Commit message (Collapse)AuthorAgeFilesLines
* re PR bootstrap/50010 (bootstrap comparison failure without CFI directives)Jakub Jelinek2011-09-121-5/+14
| | | | | | | | | PR bootstrap/50010 * dwarf2cfi.c (add_cfis_to_fde): Ignore non-active insns in between NOTE_INSN_CFI notes, with the exception of NOTE_INSN_SWITCH_TEXT_SECTIONS. From-SVN: r178795
* rtl.h (INSN_ANNULLED_BRANCH_P): Only allow JUMP_INSN.Richard Henderson2011-08-211-1/+1
| | | | | | | | | | | | * rtl.h (INSN_ANNULLED_BRANCH_P): Only allow JUMP_INSN. * dwarf2cfi.c (scan_trace): Test JUMP_P before INSN_ANNULLED_BRANCH_P. * resource.c (next_insn_no_annul): Likewise. (mark_set_resources): Likewise. * reorg.c (delete_from_delay_slot): Likewise. (dbr_schedule, redundant_insn, try_merge_delay_insns): Likewise. (get_branch_condition): Test pc_rtx and LABEL_REF before dereferencing. From-SVN: r177944
* re PR rtl-optimization/49977 (CFI notes are missed for delayed slot)Richard Henderson2011-08-051-28/+72
| | | | | | | | PR rtl-opt/49977 * dwarf2cfi.c (scan_insn_after): Split out of ... (scan_trace): ... here. Correctly place notes wrt sequences. From-SVN: r177466
* re PR debug/49864 (ICE: in maybe_record_trace_start, at dwarf2cfi.c:2439)Richard Henderson2011-08-021-368/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR target/49864 * reg-notes.def (REG_ARGS_SIZE): New. * calls.c (emit_call_1): Emit REG_ARGS_SIZE for call_pop. (expand_call): Add REG_ARGS_SIZE to emit_stack_restore. * cfgcleanup.c (old_insns_match_p): Don't allow cross-jumping to different stack levels. * combine-stack-adj.c (adjust_frame_related_expr): Remove. (maybe_move_args_size_note): New. (combine_stack_adjustments_for_block): Use it. * combine.c (distribute_notes): Place REG_ARGS_SIZE. * dwarf2cfi.c (dw_cfi_row_struct): Remove args_size member. (dw_trace_info): Add beg_true_args_size, end_true_args_size, beg_delay_args_size, end_delay_args_size, eh_head, args_size_undefined. (cur_cfa): New. (queued_args_size): Remove. (add_cfi_args_size): Assert size is non-negative. (stack_adjust_offset, dwarf2out_args_size): Remove. (dwarf2out_stack_adjust, dwarf2out_notice_stack_adjust): Remove. (notice_args_size, notice_eh_throw): New. (dwarf2out_frame_debug_def_cfa): Use cur_cfa. (dwarf2out_frame_debug_adjust_cfa): Likewise. (dwarf2out_frame_debug_cfa_offset): Likewise. (dwarf2out_frame_debug_expr): Likewise. Don't stack_adjust_offset. (dwarf2out_frame_debug): Don't handle non-frame-related-p insns. (change_cfi_row): Don't emit args_size. (maybe_record_trace_start_abnormal): Split out from ... (maybe_record_trace_start): Here. Set args_size_undefined. (create_trace_edges): Update to match. (scan_trace): Handle REG_ARGS_SIZE. (connect_traces): Connect args_size between EH insns. * emit-rtl.c (try_split): Handle REG_ARGS_SIZE. * explow.c (suppress_reg_args_size): New. (adjust_stack_1): Split out from ... (adjust_stack): ... here. (anti_adjust_stack): Use it. (allocate_dynamic_stack_space): Suppress REG_ARGS_SIZE. * expr.c (mem_autoinc_base): New. (fixup_args_size_notes): New. (emit_single_push_insn_1): Rename from emit_single_push_insn. (emit_single_push_insn): New. Generate REG_ARGS_SIZE. * recog.c (peep2_attempt): Handle REG_ARGS_SIZE. * reload1.c (reload_as_needed): Likewise. * rtl.h (fixup_args_size_notes): Declare. From-SVN: r177218
* h8300: Generate correct unwind info around swap_into/out_of_er6.Richard Henderson2011-08-021-18/+11
| | | | | | | | Minimal bug fix is to unset RTX_FRAME_RELATED_P on the PUSH insn generated in h8300_swap_into_er6. But with a tiny bit of effort we can generate real unwind info around the sequence. From-SVN: r177209
* dwarf2cfi: Generate remember/restore_state.Richard Henderson2011-07-251-32/+85
| | | | From-SVN: r176772
* dwarf2cfi: Add debug_cfi_row.Richard Henderson2011-07-251-0/+32
| | | | From-SVN: r176771
* re PR debug/49831 (arm-linux-gnueabi bootstrap failures due to ICE in ↵Richard Henderson2011-07-241-3/+13
| | | | | | | | | | | | | | dwarf2cfi.c connect_traces) PR debug/49831 * dwarf2cfi.c (connect_traces): Allow unvisited traces. Skip them entirely. Constant pools are emitted in such a way as to be indistinguishable from regular instructions, and these constant pools are, naturally, not reachable as code. From-SVN: r176730
* re PR debug/49825 (Many testcase failures)Richard Henderson2011-07-241-10/+9
| | | | | | | | PR debug/49825 * dwarf2cfi.c (dwarf2out_stack_adjust): Move A_O_A test earlier. (dwarf2out_notice_stack_adjust): Use args_size from call_insn. From-SVN: r176729
* re PR debug/49827 (sparc64-linux and cris-elf bootstrap failures due to ICE ↵Richard Henderson2011-07-241-0/+8
| | | | | | | | | in dwarf2cfi.c connect_traces) PR debug/49827 * dwarf2cfi.c (create_trace_edges): Handle sequences properly. From-SVN: r176728
* dwarf2cfi: Reset args_size properly across abnormal edges.Richard Henderson2011-07-241-8/+13
| | | | | | | * dwarf2cfi.c (maybe_record_trace_start): Add abnormal parameter. Zero args_size for abnormal edges. Adjust all callers. From-SVN: r176727
* re PR debug/49825 (Many testcase failures)Richard Henderson2011-07-241-2/+9
| | | | | | | | | | PR debug/49825 Test case gcc.c-torture/compile/pr49474.c, among others. * dwarf2cfi.c (cfi_row_equal_p): Don't compare args_size. From-SVN: r176726
* dwarf2cfi: Generate and connect traces.Richard Henderson2011-07-231-407/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This kinda-sorta corresponds to Bernd's 007-dw2cfi patch. Certainly the same concepts of splitting the instruction stream into extended basic blocks is the same. This patch does a bit better job with the documentation. Also, I'm a bit more explicit about matching things up with the similar code from the regular CFG routines. What's missing at this point is any attempt to use DW_CFA_remember_state. I've deferred that for the moment because it's easy to test the state change code across epilogues, whereas the shrink-wrapping code is not in this tree and section switching is difficult to force. * dwarf2cfi.c: Include basic-block.h. (dw_label_info): Remove. (trace_work_list, trace_index): New. (remember_row, emit_cfa_remember): Remove. (dw_trace_info_hash, dw_trace_info_eq): New. (get_trace_index, get_trace_info): New. (save_point_p): New. (free_cfi_row): Remove. (add_cfi): Do not emit DW_CFA_remember_state. (cfa_row_equal_p): New. (barrier_args_size): Remove. (compute_barrier_args_size_1, compute_barrier_args_size): Remove. (dwarf2out_notice_stack_adjust): Don't compute_barrier_args_size. (maybe_record_trace_start, create_trace_edges, scan_trace): New. (dwarf2out_cfi_begin_epilogue): Remove. (dwarf2out_frame_debug_restore_state): Remove. (connect_traces, create_pseudo_cfg): New. (create_cfi_notes, execute_dwarf2_frame): Rewrite using traces. * Makefile.in (dwarf2cfi.o): Update. From-SVN: r176705
* dwarf2cfi: Introduce dw_trace_info.Richard Henderson2011-07-231-174/+266
| | | | | | | | | | | | | | | | | | | | | This patch only introduces the structure definition and adjusts the existing routines to use the new cur_trace global to access the variables that were moved into the structure. * dwarf2cfi.c (dw_trace_info): New. (dw_label_info): New. (cie_return_save): New. (cur_trace): New. (queued_args_size): Rename from args_size. Update all users. (cfa_store, cfa_temp, regs_saved_in_regs): Remove. (def_cfa_1): Use cur_trace instead of cfa_*. (dwarf2out_stack_adjust, record_reg_saved_in_reg): Likewise. (clobbers_queued_reg_save, reg_saved_in): Likewise. (dwarf2out_frame_debug_expr): Likewise. (create_cie_data): Split out from ... (execute_dwarf2_frame): ... here. Initialize cur_trace. From-SVN: r176704
* dwarf2cfi: Allocate reg_saved_in_data in the heap.Richard Henderson2011-07-231-9/+10
| | | | | | | | * dwarf2cfi.c (regs_saved_in_regs): Allocate from heap, not gc. Update all users to match. (execute_dwarf2_frame): Free reg_saved_in_data. From-SVN: r176703
* dwarf2cfi: Convert queued_reg_save to a VEC.Richard Henderson2011-07-231-25/+26
| | | | | | | | | | | | | | Also, allocate it in the heap instead of garbage collected. * dwarf2cfi.c (queued_reg_save): Reorder for packing. Don't GTY. (queued_reg_saves): Don't GTY. Change to a VEC. (queue_reg_save): Update to match. (dwarf2out_flush_queued_reg_saves): Likewise. (clobbers_queued_reg_save): Likewise. (reg_saved_in): Likewise. (execute_dwarf2_frame): Free queued_reg_saves. From-SVN: r176702
* dwarf2cfi: Remove dw_cfi_row_ref typedef.Richard Henderson2011-07-231-12/+11
| | | | | | * dwarf2cfi.c (dw_cfi_row_ref): Remove. Update all users. From-SVN: r176701
* dwarf2cfi: Implement change_cfi_row.Richard Henderson2011-07-231-208/+168
| | | | | | | | | | | | | | | | | | | | | | | | | Add a generic function to adjust cfi state from one row to another. Use this to implement text section switching. This will also be usable for arbitrary changes around a cfg for shrink-wrapping. * dwarf2cfi.c (add_cfi_args_size): Split out from... (dwarf2out_args_size): ... here. (add_cfi_restore): Split out from ... (dwarf2out_frame_debug_cfa_restore): ... here. (def_cfa_0): Split out from ... (def_cfa_1): ... here. (cfi_oprnd_equal_p, cfi_equal_p): New. (change_cfi_row): New. (add_cfis_to_fde): Set fde->dw_fde_switch_cfi_index. (create_cfi_notes): Use change_cfi_row at SWITCH_TEXT note. (output_cfis): Remove. * dwarf2out.c (output_fde): Simplify output_cfi loop. (dwarf2out_switch_text_section): Don't call output_cfis. (dw_val_equal_p, loc_descr_equal_p_1, loc_descr_equal_p): New. * dwarf2out.h: Update decls. (enum dw_val_class): Add dw_val_class_none. From-SVN: r176700
* dwarf2cfi: Populate CUR_ROW->REG_SAVE.Richard Henderson2011-07-231-2/+25
| | | | | | | | | | | To be actually used by a subsequent patch. * dwarf2cfi.c (update_row_reg_save): New. (dwarf2out_frame_debug_cfa_expression): Use it. (dwarf2out_frame_debug_cfa_restore): Likewise. (reg_save): Likewise. Do not emit DW_CFA_same_value. From-SVN: r176699
* dwarf2cfi: Rename cfi_insn to add_cfi_insn.Richard Henderson2011-07-231-9/+11
| | | | | | | | Make it consistent with add_cfi_vec. * dwarf2cfi.c (add_cfi_insn): Rename from cfi_insn. Update all users. From-SVN: r176698
* dwarf2cfi: Introduce a dw_cfi_row state.Richard Henderson2011-07-231-74/+134
| | | | | | | | | | | | | | | | | | | | | | | | | Use it instead of old_cfa, old_args_size, and cfa_remember variables. Remove the global cfa variable, as it was usually a duplicate of old_cfa and otherwise confusing. Always make a local copy of the cur_row->cfa variable before modification instead. * dwarf2cfi.c (dw_cfi_row, dw_cfi_row_ref): New. (cie_cfi_row): New. (new_cfi_row, copy_cfi_row, free_cfi_row): New. (cfa, old_cfa, cfa_remember, old_cfa_remember, old_args_size): Remove. (cur_row, remember_row): New. (def_cfa_1): Use cur_row instead of the old_* variables. (dwarf2out_frame_debug_restore_state): Similarly. (dwarf2out_args_size, dwarf2out_notice_stack_adjust): Likewise. (dwarf2out_frame_debug_def_cfa): Use a local variable instead of cfa. (dwarf2out_frame_debug_adjust_cfa): Likewise. (dwarf2out_frame_debug_cfa_offset): Likewise. (dwarf2out_frame_debug_expr): Likewise. (execute_dwarf2_frame): Set up cur_row. * dwarf2out.h (struct cfa_loc): Mark for GTY. From-SVN: r176697
* re PR target/49713 (Conflicting types for 'arm_dbx_register_number')Richard Henderson2011-07-121-31/+35
| | | | | | | | | | | | | | | | PR target/49713 * dwarf2out.h (dwarf_frame_regnum): Remove. * dwarf2out.c (based_loc_descr): Revert last change. Initialize regno earlier from DWARF_FRAME_REGNUM. Never use dbx_reg_number. * dwarf2cfi.c (dw_stack_pointer_regnum, dw_frame_pointer_regnum): New. (execute_dwarf2_frame): Initialize them. (DW_STACK_POINTER_REGNUM, DW_FRAME_POINTER_REGNUM): Remove; replace users of the macros with the variables. (expand_builtin_dwarf_sp_column): Revert last change. (expand_builtin_init_dwarf_reg_sizes): Likewise. Compute the result of DWARF_FRAME_REGNUM into a local variable. From-SVN: r176212
* dwarf2cfi.c (DW_STACK_POINTER_REGNUM): New.Richard Henderson2011-07-111-73/+81
| | | | | | | | | | | | | | | | | * dwarf2cfi.c (DW_STACK_POINTER_REGNUM): New. (DW_FRAME_POINTER_REGNUM): New. (expand_builtin_init_dwarf_reg_sizes): Use unsigned for rnum. (def_cfa_1): Do not convert reg to DWARF_FRAME_REGNUM here. (dwf_regno): New. (dwarf2out_flush_queued_reg_saves, dwarf2out_frame_debug_def_cfa, dwarf2out_frame_debug_adjust_cfa, dwarf2out_frame_debug_cfa_register, dwarf2out_frame_debug_cfa_expression, dwarf2out_frame_debug_expr): Use it. * dwarf2out.c (based_loc_descr): Use dwarf_frame_regnum. * dwarf2out.h (dwarf_frame_regnum): New. (struct cfa_loc): Document the domain of the reg member. From-SVN: r176178
* dwarf2: Move CFI output routines to dwarf2cfi.c.Richard Henderson2011-07-091-0/+567
| | | | | | | | | | | | | | | | | * defaults.h (DWARF2_ADDR_SIZE, DWARF_OFFSET_SIZE, DWARF_TYPE_SIGNATURE_SIZE): Move from ... * dwarf2out.c: ... here. (output_all_cfis): Remove. (dwarf2out_switch_text_section): Use output_cfis directly. (size_of_locs): Export. (output_loc_sequence, output_loc_sequence_raw): Export. (div_data_align, need_data_align_sf_opcode, dwarf_cfi_name, output_cfi, output_cfi_directive, dwarf2out_emit_cfi, output_cfis, output_cfa_loc, output_cfa_loc_raw): Move to ... * dwarfcfi.c: ... here. * dwarf2out.h: Update decls. From-SVN: r176107
* dwarf2: Reduce some redundant definitions.Richard Henderson2011-07-091-80/+0
| | | | | | | | | | | | | | | | Move some definitions to defaults.h; some simply aren't needed anymore in the respective dwarf2{cfi,out}.c files. * defaults.h (DWARF_CIE_DATA_ALIGNMENT, DWARF_FRAME_RETURN_COLUMN, DWARF_FRAME_REGNUM, DWARF2_FRAME_REG_OUT): Move from ... * dwarf2cfi.c: ... here. (PTR_SIZE, DWARF_OFFSET_SIZE, DWARF_INITIAL_LENGTH_SIZE): Remove. (DWARF_ROUND, DWARF_CIE_ID): Remove. * dwarf2out.c (INCOMING_RETURN_ADDR_RTX): Remove. (DWARF2_FRAME_REG_OUT, DWARF_CIE_DATA_ALIGNMENT): Remove. (DWARF_FRAME_RETURN_COLUMN, DWARF_FRAME_REGNUM): Remove. From-SVN: r176102
* dwarf2cfi: Handle return column save from CIE.Richard Henderson2011-07-091-96/+126
| | | | | | | | | | | | | | | | | | | | | | When we record a save of the return column in the CIE, remember that while processing the FDE. This requires propagating the handling of PC_RTX as a representative of the return column to more locations. MIPS had been handling this case by hand, and is no longer required. * dwarf2cfi.c (cie_return_save): New. (queue_reg_save): Use compare_reg_or_pc. (dwarf2out_flush_queued_reg_saves): Handle pc_rtx as return column. (dwarf2out_frame_debug_expr): Likewise. (dwarf2out_frame_debug_cfa_register): Record saved reg for pc too. (initial_return_save): Likewise. (execute_dwarf2_frame): Save and restore initial return save from the cie to the fde. * config/mips/mips.c (mips_frame_set): Remove special case for DWARF_FRAME_RETURN_COLUMN. From-SVN: r176099
* dwarf2cfi: Simplify re-initialization for each function.Richard Henderson2011-07-091-32/+13
| | | | | | | | | | | | There's no point calling lookup_cfa to re-create the CFA we initialized just a few lines above. * dwarf2cfi.c (lookup_cfa): Remove. (execute_dwarf2_frame): Assert queues are empty on entry. Setup initial cfa directly, not via lookup_cfa. Don't clear args_size state here. From-SVN: r176098
* dwarf2cfi: Unify add_fde_cfi and add_cie_cfi.Richard Henderson2011-07-091-46/+36
| | | | | | | | | * dwarf2cfi.c (add_cfi_vec): New. (add_cfi): Rename from add_fde_cfi. Add the element to add_cfi_vec. (def_cfa_1, reg_save): Remove for_cie argument. Update all callers. (execute_dwarf2_frame): Set add_cfi_vec. From-SVN: r176095
* re PR rtl-optimization/49686 (CFI notes are missed for delayed slot)Richard Henderson2011-07-091-16/+9
| | | | | | | | PR debug/49686 * dwarf2cfi.c (dwarf2out_frame_debug): Don't set cfi_insn here... (create_cfi_notes): ... do it here instead. From-SVN: r176091
* dwarf2cfi: Flush queued saves at the end of the prologue.Richard Henderson2011-07-081-0/+7
| | | | | | | | | | There's little point at holding onto these saves indefinitely. PR bootstrap/49680 * dwarf2cfi.c (create_cfi_notes): Flush queued saves at the end of the prologue. From-SVN: r176066
* dwarf2cfi: Insert notes correctly wrt tablejumps.Richard Henderson2011-07-081-2/+10
| | | | | | | | PR bootstrap/49680 * dwarf2cfi.c (dwarf2out_frame_debug): Insert cfi notes after any tablejump vector. From-SVN: r176065
* dwarf2: Extract cfi creation to a new pass.Richard Henderson2011-07-071-64/+97
| | | | | | | | | | | | | | | | | | | | | | | * tree-pass.h (pass_dwarf2_frame): Declare. * passes.c (init_optimization_passes): Add it. * dwarf2cfi.c (dwarf2out_frame_debug): Make static. (create_cfi_notes): Rename from dwarf2out_frame_debug_after_prologue; make static, do not call add_cfis_to_fde. (dwarf2out_frame_debug_init, dwarf2cfi_function_init, dwarf2out_frame_init): Merge into... (execute_dwarf2_frame): ... here. New function. (dwarf2out_do_frame, dwarf2out_do_cfi_asm): Make boolean. Change saved_do_cfi_asm to a tri-state variable. (gate_dwarf2_frame, pass_dwarf2_frame): New. * dwarf2out.c (dwarf2out_begin_prologue): Only allocate the fde if it has yet to be done. Don't call dwarf2cfi_function_init. * dwarf2out.h, debug.h: Update decls. * final.c (final_start_function): Don't call dwarf2out_frame_debug_init or dwarf2out_frame_debug_after_prologue. * lto-streamer-in.c (lto_init_eh): Don't call dwarf2out_frame_init. * toplev.c (lang_dependent_init): Likewise. From-SVN: r176019
* dwarf2out: Convert fde_table to a VEC.Richard Henderson2011-07-071-8/+8
| | | | | | | | | | | | | | | | | | | | | | Prepare for allocating the FDE for the current function earlier than dwarf2out_begin_prologue. * dwarf2out.c (fde_table, fde_table_allocated, fde_table_in_use, FDE_TABLE_INCREMENT): Replace with... (fde_vec): ... this, a new vector. (current_fde): Remove. Replace all users with cfun->fde. (output_call_frame_info): Use FOR_EACH_VEC_ELT over fde_vec. (size_of_aranges, dwarf2out_finish): Likewise. (dwarf2out_alloc_current_fde): Break out from ... (dwarf2out_begin_prologue): ... here. (dwarf2out_frame_init): Remove. * dwarf2cfi.c: Update all users of current_fde. (dwarf2out_frame_init): Rename from dwarf2cfi_frame_init. * dwarf2out.h: Update decls. (dw_fde_node): Add fde_index member. * function.h (struct function): Add fde member. From-SVN: r176018
* dwarf2out: Emit NOTE_INSN_CFI_* both with and without cfi-asm.Bernd Schmidt2011-07-071-224/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is essentially Bernd's 006-cfilabel patch, updated for all the other changes to dwarf2out. The patch reduces the difference between the cfi-asm and non-cfi-asm code paths. We now emit the CFI notes in all cases. Later, after we're done producing the CFI insns we need, another pass over the rtl adds the necessary labels and set_loc/advance_loc CFIs. One consequence of this is that def_cfa_1 can no longer use lookup_cfa, so it just compares to an old_cfa variable instead. The major change since Bernd's patch is that all the target-specific changes are no longer necessary. * dwarf2cfi.c (add_cfi): Remove. (dwarf2out_cfi_label): Remove force argument. Only generate the label name. (add_fde_cfi): Simplify the different code paths. (add_cie_cfi): New. (old_cfa, old_cfa_remember): New. (def_cfa_1, reg_save): Remove label, add for_cie parameter. (last_reg_save_label): Remove. (dwarf2out_args_size, dwarf2out_stack_adjust, queue_reg_save, dwarf2out_frame_debug_def_cfa, dwarf2out_frame_debug_adjust_cfa, dwarf2out_frame_debug_cfa_offset, dwarf2out_frame_debug_cfa_register, dwarf2out_frame_debug_cfa_expression, dwarf2out_frame_debug_cfa_restore, dwarf2out_frame_debug_cfa_window_save, dwarf2out_frame_debug_expr): Remove label parameter. (cfi_label_required_p, add_cfis_to_fde): New. (dwarf2out_frame_debug_after_prologue): New. (dwarf2cfi_frame_init): Initialize old_cfa. (dwarf2out_frame_debug_restore_state): Likewise. * dwarf2out.c (dwarf2out_emit_cfi): Only do output for cfi_asm. (dwarf2out_switch_text_section): Don't clear dw_fde_current_label here. * final.c (final_start_function): Call dwarf2out_frame_debug_after_prologue. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r176017
* dwarf2out: Move insn scanning out of final.c.Bernd Schmidt2011-07-071-17/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is essentially Bernd's 005-scanfirst patch, updated for the introduction of the dwarf2cfi.c file. We introduce NOTE_INSN_CFI and NOTE_INSN_CFI_LABEL to hold the dwarf2 info during the bulk of final. The actual construction of these notes still happens during final, right at the very beginning of the pass, via the dwarf2out_frame_debug_init hook. * dwarf2cfi.c (cfi_insn): New. (dwarf2out_cfi_label): Don't emit cfi label here. (add_fde_cfi): Create a NOTE_INSN_CFI. (dwarf2out_frame_debug): Setup cfi_insn. (dwarf2out_frame_debug_init): Loop over insns creating CFI notes. (dwarf2out_cfi_begin_epilogue): Make static. (dwarf2out_frame_debug_restore_state): Make static. * dwarf2out.c (output_cfi_directive): Make static. (dwarf2out_emit_cfi): New. * dwarf2out.h: Update. * final.c (final): Remove CFI notes. (final_scan_insn): Don't call dwarf2out_cfi_begin_epilogue, dwarf2out_frame_debug_restore_state, dwarf2out_frame_debug. Handle NOTE_INSN_CFI and NOTE_INSN_CFI_LABEL. * insn-notes.def (NOTE_INSN_CFI): New. (NOTE_INSN_CFI_LABEL): New. * rtl.h (union rtunion_def): Add rt_cfi member. (XCFI, XCCFI, NOTE_CFI, NOTE_LABEL_NUMBER): New. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r176016
* dwarf2out: Split CFI construction routines into a new file.Richard Henderson2011-07-071-0/+2656
Excepting changing some functions from static to extern, this patch contains code motion only. The split is not very clean at this point, but will be refined as CFI construction is turned into its own proper pass. * dwarf2cfi.c: New file. * Makefile.in (OBJS): Add it. (GTFILES): Add dwarf2cfi.c and dwarf2out.h. * gengtype.c (open_base_files): Include dwarf2out.h. * coretypes.h (enum var_init_status): Move from ... * rtl.h: ... here. * dwarf2out.c (saved_do_cfi_asm, dwarf2out_do_frame, dwarf2out_do_cfi_asm, cie_cfi_vec, dwarf2out_cfi_label_num, expand_builtin_dwarf_sp_column, init_return_column_size, expand_builtin_init_dwarf_reg_sizes, new_cfi, add_cfi, dwarf2out_cfi_label, emit_cfa_remember, any_cfis_emitted, add_fde_cfi, lookup_cfa_1, lookup_cfa, cfa, cfa_store, cfa_remember, args_size, old_args_size, cfa_equal_p, def_cfa_1, reg_save, initial_return_save, stack_adjust_offset, barrier_args_size, compute_barrier_args_size_1, compute_barrier_args_size, dwarf2out_args_size, dwarf2out_stack_adjust, dwarf2out_notice_stack_adjust, queued_reg_saves, reg_saved_in_data, regs_saved_in_regs, compare_reg_or_pc, record_reg_saved_in_reg, last_reg_save_label, queue_reg_save, dwarf2out_flush_queued_reg_saves, clobbers_queued_reg_save, reg_saved_in, cfa_temp, dwarf2out_frame_debug_def_cfa, dwarf2out_frame_debug_adjust_cfa, dwarf2out_frame_debug_cfa_offset, dwarf2out_frame_debug_cfa_register, dwarf2out_frame_debug_cfa_expression, dwarf2out_frame_debug_cfa_restore, dwarf2out_frame_debug_cfa_window_save, dwarf2out_frame_debug_expr, dwarf2out_frame_debug, dwarf2out_frame_debug_init, dwarf2out_cfi_begin_epilogue, dwarf2out_frame_debug_restore_state, get_cfa_from_loc_descr): Move to dwarf2cfi.c. (dw_cfi_ref, dw_fde_ref, dw_cfi_oprnd_ref, enum dw_cfi_oprnd_type, dw_cfi_oprnd, dw_cfi_node, cfi_vec, dw_cfa_location, dw_fde_node, dw_val_ref, dw_die_ref, const_dw_die_ref, dw_loc_descr_ref, dw_loc_list_ref, enum dw_val_class, dw_vec_const, dw_val_node, dw_loc_descr_node): Move to dwarf2out.h. (current_fde, output_cfi_directive, build_cfa_loc, get_address_mode, mem_loc_descriptor): Export. (build_cfa_aligned_loc): Export. Take CFA as a parameter. (dwarf2out_frame_init): Extract CIE generation code to dwarf2cfi_frame_init. From-SVN: r176015