summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-04-27 01:38:58 -0700
committerYamaArashi <shadow962@live.com>2016-04-27 01:38:58 -0700
commit0fd2209ea0d16df6b320fbac167dc20d89110cb2 (patch)
treeb492be075eb53a98cf7b7653882e89e0a93f2b23 /gcc
parent9dc75fe3b4be91d6066c8e870eacec954117cc08 (diff)
remove dead dwarf-2 code
Diffstat (limited to 'gcc')
-rw-r--r--gcc/Makefile2
-rwxr-xr-xgcc/defaults.h6
-rwxr-xr-xgcc/dwarf2out.c1357
-rwxr-xr-xgcc/dwarf2out.h3
-rwxr-xr-xgcc/except.h2
-rwxr-xr-xgcc/expr.c7
-rwxr-xr-xgcc/final.c42
-rwxr-xr-xgcc/output.h4
-rwxr-xr-xgcc/real.c17
-rwxr-xr-xgcc/toplev.c28
-rwxr-xr-xgcc/tree.h58
-rwxr-xr-xgcc/varasm.c15
12 files changed, 10 insertions, 1531 deletions
diff --git a/gcc/Makefile b/gcc/Makefile
index e677c70..782d5e2 100644
--- a/gcc/Makefile
+++ b/gcc/Makefile
@@ -22,7 +22,7 @@
srcdir = .
VPATH = $(srcdir)
-CFLAGS = -g -std=gnu11
+CFLAGS = -g -std=gnu11 -Wunused-function
CC = gcc
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 1b8792a..e7241e4 100755
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -122,9 +122,3 @@ do { fprintf (FILE, "\t%s\t", ASM_LONG); \
#define SUPPORTS_WEAK 0
#endif
#endif
-
-/* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
- the rest of the DWARF 2 frame unwind support is also provided. */
-#if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
-#define DWARF2_UNWIND_INFO 1
-#endif
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 8298494..184953f 100755
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -52,17 +52,10 @@ Boston, MA 02111-1307, USA. */
int
dwarf2out_do_frame ()
{
- return (write_symbols == DWARF2_DEBUG
-#ifdef DWARF2_FRAME_INFO
- || DWARF2_FRAME_INFO
-#endif
-#ifdef DWARF2_UNWIND_INFO
- || (flag_exceptions && ! exceptions_via_longjmp)
-#endif
- );
+ return (write_symbols == DWARF2_DEBUG);
}
-#if defined (DWARF2_DEBUGGING_INFO) || defined (DWARF2_UNWIND_INFO)
+#if defined (DWARF2_DEBUGGING_INFO)
#ifndef __GNUC__
#define inline
@@ -131,7 +124,7 @@ dw_fde_node;
/* The size in bytes of a DWARF field indicating an offset or length
relative to a debug info section, specified to be 4 bytes in the DWARF-2
- specification. The SGI/MIPS ABI defines it to be the same as PTR_SIZE. */
+ specification. */
#ifndef DWARF_OFFSET_SIZE
#define DWARF_OFFSET_SIZE 4
@@ -183,24 +176,11 @@ static unsigned current_funcdef_fde;
/* Forward declarations for functions defined in this file. */
static char *stripattributes (char *);
-static char *dwarf_cfi_name (unsigned);
-static dw_cfi_ref new_cfi (void);
-static void add_cfi (dw_cfi_ref *, dw_cfi_ref);
static unsigned long size_of_uleb128 (unsigned long);
static unsigned long size_of_sleb128 (long);
static void output_uleb128 (unsigned long);
static void output_sleb128 (long);
-static void add_fde_cfi (char *, dw_cfi_ref);
-static void lookup_cfa_1 (dw_cfi_ref, unsigned long *,
- long *);
-static void lookup_cfa (unsigned long *, long *);
-static void reg_save (char *, unsigned, unsigned,
- long);
-static void initial_return_save (rtx);
-static void output_cfi (dw_cfi_ref, dw_fde_ref);
-static void output_call_frame_info (int);
static unsigned reg_number (rtx);
-static void dwarf2out_stack_adjust (rtx);
/* Definitions of defaults for assembler-dependent names of various
pseudo-ops and section names.
@@ -496,14 +476,6 @@ static void dwarf2out_stack_adjust (rtx);
#define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
#endif
-/* Hook used by __throw. */
-
-rtx
-expand_builtin_dwarf_fp_regnum ()
-{
- return GEN_INT (DWARF_FRAME_REGNUM (FRAME_POINTER_REGNUM));
-}
-
/* The offset from the incoming value of %sp to the top of the stack frame
for the current function. */
#ifndef INCOMING_FRAME_SP_OFFSET
@@ -547,300 +519,6 @@ reg_number (rtl)
return regno;
}
-struct reg_size_range
-{
- int beg;
- int end;
- int size;
-};
-
-/* Given a register number in REG_TREE, return an rtx for its size in bytes.
- We do this in kind of a roundabout way, by building up a list of
- register size ranges and seeing where our register falls in one of those
- ranges. We need to do it this way because REG_TREE is not a constant,
- and the target macros were not designed to make this task easy. */
-
-rtx
-expand_builtin_dwarf_reg_size (reg_tree, target)
- tree reg_tree;
- rtx target;
-{
- enum machine_mode mode;
- int size;
- struct reg_size_range ranges[5];
- tree t, t2;
-
- int i = 0;
- int n_ranges = 0;
- int last_size = -1;
-
- for (; i < FIRST_PSEUDO_REGISTER; ++i)
- {
- /* The return address is out of order on the MIPS, and we don't use
- copy_reg for it anyway, so we don't care here how large it is. */
- if (DWARF_FRAME_REGNUM (i) == DWARF_FRAME_RETURN_COLUMN)
- continue;
-
- mode = reg_raw_mode[i];
-
- /* CCmode is arbitrarily given a size of 4 bytes. It is more useful
- to use the same size as word_mode, since that reduces the number
- of ranges we need. It should not matter, since the result should
- never be used for a condition code register anyways. */
- if (GET_MODE_CLASS (mode) == MODE_CC)
- mode = word_mode;
-
- size = GET_MODE_SIZE (mode);
-
- /* If this register is not valid in the specified mode and
- we have a previous size, use that for the size of this
- register to avoid making junk tiny ranges. */
- if (! HARD_REGNO_MODE_OK (i, mode) && last_size != -1)
- size = last_size;
-
- if (size != last_size)
- {
- ranges[n_ranges].beg = i;
- ranges[n_ranges].size = last_size = size;
- ++n_ranges;
- if (n_ranges >= 5)
- abort ();
- }
- ranges[n_ranges-1].end = i;
- }
-
- /* The usual case: fp regs surrounded by general regs. */
- if (n_ranges == 3 && ranges[0].size == ranges[2].size)
- {
- if ((DWARF_FRAME_REGNUM (ranges[1].end)
- - DWARF_FRAME_REGNUM (ranges[1].beg))
- != ranges[1].end - ranges[1].beg)
- abort ();
- t = fold (build (GE_EXPR, integer_type_node, reg_tree,
- build_int_2 (DWARF_FRAME_REGNUM (ranges[1].beg), 0)));
- t2 = fold (build (LE_EXPR, integer_type_node, reg_tree,
- build_int_2 (DWARF_FRAME_REGNUM (ranges[1].end), 0)));
- t = fold (build (TRUTH_ANDIF_EXPR, integer_type_node, t, t2));
- t = fold (build (COND_EXPR, integer_type_node, t,
- build_int_2 (ranges[1].size, 0),
- build_int_2 (ranges[0].size, 0)));
- }
- else
- {
- /* Initialize last_end to be larger than any possible
- DWARF_FRAME_REGNUM. */
- int last_end = 0x7fffffff;
- --n_ranges;
- t = build_int_2 (ranges[n_ranges].size, 0);
- do
- {
- int beg = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
- int end = DWARF_FRAME_REGNUM (ranges[n_ranges].end);
- if (beg < 0)
- continue;
- if (end >= last_end)
- abort ();
- last_end = end;
- if (end - beg != ranges[n_ranges].end - ranges[n_ranges].beg)
- abort ();
- t2 = fold (build (LE_EXPR, integer_type_node, reg_tree,
- build_int_2 (end, 0)));
- t = fold (build (COND_EXPR, integer_type_node, t2,
- build_int_2 (ranges[n_ranges].size, 0), t));
- }
- while (--n_ranges >= 0);
- }
- return expand_expr (t, target, Pmode, 0);
-}
-
-/* Convert a DWARF call frame info. operation to its string name */
-
-static char *
-dwarf_cfi_name (cfi_opc)
- register unsigned cfi_opc;
-{
- switch (cfi_opc)
- {
- case DW_CFA_advance_loc:
- return "DW_CFA_advance_loc";
- case DW_CFA_offset:
- return "DW_CFA_offset";
- case DW_CFA_restore:
- return "DW_CFA_restore";
- case DW_CFA_nop:
- return "DW_CFA_nop";
- case DW_CFA_set_loc:
- return "DW_CFA_set_loc";
- case DW_CFA_advance_loc1:
- return "DW_CFA_advance_loc1";
- case DW_CFA_advance_loc2:
- return "DW_CFA_advance_loc2";
- case DW_CFA_advance_loc4:
- return "DW_CFA_advance_loc4";
- case DW_CFA_offset_extended:
- return "DW_CFA_offset_extended";
- case DW_CFA_restore_extended:
- return "DW_CFA_restore_extended";
- case DW_CFA_undefined:
- return "DW_CFA_undefined";
- case DW_CFA_same_value:
- return "DW_CFA_same_value";
- case DW_CFA_register:
- return "DW_CFA_register";
- case DW_CFA_remember_state:
- return "DW_CFA_remember_state";
- case DW_CFA_restore_state:
- return "DW_CFA_restore_state";
- case DW_CFA_def_cfa:
- return "DW_CFA_def_cfa";
- case DW_CFA_def_cfa_register:
- return "DW_CFA_def_cfa_register";
- case DW_CFA_def_cfa_offset:
- return "DW_CFA_def_cfa_offset";
-
- /* SGI/MIPS specific */
- case DW_CFA_MIPS_advance_loc8:
- return "DW_CFA_MIPS_advance_loc8";
-
- /* GNU extensions */
- case DW_CFA_GNU_window_save:
- return "DW_CFA_GNU_window_save";
- case DW_CFA_GNU_args_size:
- return "DW_CFA_GNU_args_size";
-
- default:
- return "DW_CFA_<unknown>";
- }
-}
-
-/* Return a pointer to a newly allocated Call Frame Instruction. */
-
-static inline dw_cfi_ref
-new_cfi ()
-{
- register dw_cfi_ref cfi = (dw_cfi_ref) xmalloc (sizeof (dw_cfi_node));
-
- cfi->dw_cfi_next = NULL;
- cfi->dw_cfi_oprnd1.dw_cfi_reg_num = 0;
- cfi->dw_cfi_oprnd2.dw_cfi_reg_num = 0;
-
- return cfi;
-}
-
-/* Add a Call Frame Instruction to list of instructions. */
-
-static inline void
-add_cfi (list_head, cfi)
- register dw_cfi_ref *list_head;
- register dw_cfi_ref cfi;
-{
- register dw_cfi_ref *p;
-
- /* Find the end of the chain. */
- for (p = list_head; (*p) != NULL; p = &(*p)->dw_cfi_next)
- ;
-
- *p = cfi;
-}
-
-/* Generate a new label for the CFI info to refer to. */
-
-char *
-dwarf2out_cfi_label ()
-{
- static char label[20];
- static unsigned long label_num = 0;
-
- ASM_GENERATE_INTERNAL_LABEL (label, "LCFI", label_num++);
- ASM_OUTPUT_LABEL (asm_out_file, label);
-
- return label;
-}
-
-/* Add CFI to the current fde at the PC value indicated by LABEL if specified,
- or to the CIE if LABEL is NULL. */
-
-static void
-add_fde_cfi (label, cfi)
- register char *label;
- register dw_cfi_ref cfi;
-{
- if (label)
- {
- register dw_fde_ref fde = &fde_table[fde_table_in_use - 1];
-
- if (*label == 0)
- label = dwarf2out_cfi_label ();
-
- if (fde->dw_fde_current_label == NULL
- || strcmp (label, fde->dw_fde_current_label) != 0)
- {
- register dw_cfi_ref xcfi;
-
- fde->dw_fde_current_label = label = xstrdup (label);
-
- /* Set the location counter to the new label. */
- xcfi = new_cfi ();
- xcfi->dw_cfi_opc = DW_CFA_advance_loc4;
- xcfi->dw_cfi_oprnd1.dw_cfi_addr = label;
- add_cfi (&fde->dw_fde_cfi, xcfi);
- }
-
- add_cfi (&fde->dw_fde_cfi, cfi);
- }
-
- else
- add_cfi (&cie_cfi_head, cfi);
-}
-
-/* Subroutine of lookup_cfa. */
-
-static inline void
-lookup_cfa_1 (cfi, regp, offsetp)
- register dw_cfi_ref cfi;
- register unsigned long *regp;
- register long *offsetp;
-{
- switch (cfi->dw_cfi_opc)
- {
- case DW_CFA_def_cfa_offset:
- *offsetp = cfi->dw_cfi_oprnd1.dw_cfi_offset;
- break;
- case DW_CFA_def_cfa_register:
- *regp = cfi->dw_cfi_oprnd1.dw_cfi_reg_num;
- break;
- case DW_CFA_def_cfa:
- *regp = cfi->dw_cfi_oprnd1.dw_cfi_reg_num;
- *offsetp = cfi->dw_cfi_oprnd2.dw_cfi_offset;
- break;
- default:
- break;
- }
-}
-
-/* Find the previous value for the CFA. */
-
-static void
-lookup_cfa (regp, offsetp)
- register unsigned long *regp;
- register long *offsetp;
-{
- register dw_cfi_ref cfi;
-
- *regp = (unsigned long) -1;
- *offsetp = 0;
-
- for (cfi = cie_cfi_head; cfi; cfi = cfi->dw_cfi_next)
- lookup_cfa_1 (cfi, regp, offsetp);
-
- if (fde_table_in_use)
- {
- register dw_fde_ref fde = &fde_table[fde_table_in_use - 1];
- for (cfi = fde->dw_fde_cfi; cfi; cfi = cfi->dw_cfi_next)
- lookup_cfa_1 (cfi, regp, offsetp);
- }
-}
-
/* The current rule for calculating the DWARF2 canonical frame address. */
static unsigned long cfa_reg;
static long cfa_offset;
@@ -856,555 +534,6 @@ static long args_size;
/* The last args_size we actually output. */
static long old_args_size;
-/* Entry point to update the canonical frame address (CFA).
- LABEL is passed to add_fde_cfi. The value of CFA is now to be
- calculated from REG+OFFSET. */
-
-void
-dwarf2out_def_cfa (label, reg, offset)
- register char *label;
- register unsigned reg;
- register long offset;
-{
- register dw_cfi_ref cfi;
- unsigned long old_reg;
- long old_offset;
-
- cfa_reg = reg;
- cfa_offset = offset;
- if (cfa_store_reg == reg)
- cfa_store_offset = offset;
-
- reg = DWARF_FRAME_REGNUM (reg);
- lookup_cfa (&old_reg, &old_offset);
-
- if (reg == old_reg && offset == old_offset)
- return;
-
- cfi = new_cfi ();
-
- if (reg == old_reg)
- {
- cfi->dw_cfi_opc = DW_CFA_def_cfa_offset;
- cfi->dw_cfi_oprnd1.dw_cfi_offset = offset;
- }
-
-#ifndef MIPS_DEBUGGING_INFO /* SGI dbx thinks this means no offset. */
- else if (offset == old_offset && old_reg != (unsigned long) -1)
- {
- cfi->dw_cfi_opc = DW_CFA_def_cfa_register;
- cfi->dw_cfi_oprnd1.dw_cfi_reg_num = reg;
- }
-#endif
-
- else
- {
- cfi->dw_cfi_opc = DW_CFA_def_cfa;
- cfi->dw_cfi_oprnd1.dw_cfi_reg_num = reg;
- cfi->dw_cfi_oprnd2.dw_cfi_offset = offset;
- }
-
- add_fde_cfi (label, cfi);
-}
-
-/* Add the CFI for saving a register. REG is the CFA column number.
- LABEL is passed to add_fde_cfi.
- If SREG is -1, the register is saved at OFFSET from the CFA;
- otherwise it is saved in SREG. */
-
-static void
-reg_save (label, reg, sreg, offset)
- register char * label;
- register unsigned reg;
- register unsigned sreg;
- register long offset;
-{
- register dw_cfi_ref cfi = new_cfi ();
-
- cfi->dw_cfi_oprnd1.dw_cfi_reg_num = reg;
-
- /* The following comparison is correct. -1 is used to indicate that
- the value isn't a register number. */
- if (sreg == (unsigned int) -1)
- {
- if (reg & ~0x3f)
- /* The register number won't fit in 6 bits, so we have to use
- the long form. */
- cfi->dw_cfi_opc = DW_CFA_offset_extended;
- else
- cfi->dw_cfi_opc = DW_CFA_offset;
-
- offset /= DWARF_CIE_DATA_ALIGNMENT;
- if (offset < 0)
- abort ();
- cfi->dw_cfi_oprnd2.dw_cfi_offset = offset;
- }
- else
- {
- cfi->dw_cfi_opc = DW_CFA_register;
- cfi->dw_cfi_oprnd2.dw_cfi_reg_num = sreg;
- }
-
- add_fde_cfi (label, cfi);
-}
-
-/* Add the CFI for saving a register window. LABEL is passed to reg_save.
- This CFI tells the unwinder that it needs to restore the window registers
- from the previous frame's window save area.
-
- ??? Perhaps we should note in the CIE where windows are saved (instead of
- assuming 0(cfa)) and what registers are in the window. */
-
-void
-dwarf2out_window_save (label)
- register char * label;
-{
- register dw_cfi_ref cfi = new_cfi ();
- cfi->dw_cfi_opc = DW_CFA_GNU_window_save;
- add_fde_cfi (label, cfi);
-}
-
-/* Add a CFI to update the running total of the size of arguments
- pushed onto the stack. */
-
-void
-dwarf2out_args_size (label, size)
- char *label;
- long size;
-{
- register dw_cfi_ref cfi;
-
- if (size == old_args_size)
- return;
- old_args_size = size;
-
- cfi = new_cfi ();
- cfi->dw_cfi_opc = DW_CFA_GNU_args_size;
- cfi->dw_cfi_oprnd1.dw_cfi_offset = size;
- add_fde_cfi (label, cfi);
-}
-
-/* Entry point for saving a register to the stack. REG is the GCC register
- number. LABEL and OFFSET are passed to reg_save. */
-
-void
-dwarf2out_reg_save (label, reg, offset)
- register char * label;
- register unsigned reg;
- register long offset;
-{
- reg_save (label, DWARF_FRAME_REGNUM (reg), -1, offset);
-}
-
-/* Entry point for saving the return address in the stack.
- LABEL and OFFSET are passed to reg_save. */
-
-void
-dwarf2out_return_save (label, offset)
- register char * label;
- register long offset;
-{
- reg_save (label, DWARF_FRAME_RETURN_COLUMN, -1, offset);
-}
-
-/* Entry point for saving the return address in a register.
- LABEL and SREG are passed to reg_save. */
-
-void
-dwarf2out_return_reg (label, sreg)
- register char * label;
- register unsigned sreg;
-{
- reg_save (label, DWARF_FRAME_RETURN_COLUMN, sreg, 0);
-}
-
-/* Record the initial position of the return address. RTL is
- INCOMING_RETURN_ADDR_RTX. */
-
-static void
-initial_return_save (rtl)
- register rtx rtl;
-{
- unsigned int reg = (unsigned int) -1;
- long offset = 0;
-
- switch (GET_CODE (rtl))
- {
- case REG:
- /* RA is in a register. */
- reg = reg_number (rtl);
- break;
- case MEM:
- /* RA is on the stack. */
- rtl = XEXP (rtl, 0);
- switch (GET_CODE (rtl))
- {
- case REG:
- if (REGNO (rtl) != STACK_POINTER_REGNUM)
- abort ();
- offset = 0;
- break;
- case PLUS:
- if (REGNO (XEXP (rtl, 0)) != STACK_POINTER_REGNUM)
- abort ();
- offset = INTVAL (XEXP (rtl, 1));
- break;
- case MINUS:
- if (REGNO (XEXP (rtl, 0)) != STACK_POINTER_REGNUM)
- abort ();
- offset = -INTVAL (XEXP (rtl, 1));
- break;
- default:
- abort ();
- }
- break;
- case PLUS:
- /* The return address is at some offset from any value we can
- actually load. For instance, on the SPARC it is in %i7+8. Just
- ignore the offset for now; it doesn't matter for unwinding frames. */
- if (GET_CODE (XEXP (rtl, 1)) != CONST_INT)
- abort ();
- initial_return_save (XEXP (rtl, 0));
- return;
- default:
- abort ();
- }
-
- reg_save (NULL, DWARF_FRAME_RETURN_COLUMN, reg, offset - cfa_offset);
-}
-
-/* Check INSN to see if it looks like a push or a stack adjustment, and
- make a note of it if it does. EH uses this information to find out how
- much extra space it needs to pop off the stack. */
-
-static void
-dwarf2out_stack_adjust (insn)
- rtx insn;
-{
- long offset;
- char *label;
-
- if (! asynchronous_exceptions && GET_CODE (insn) == CALL_INSN)
- {
- /* Extract the size of the args from the CALL rtx itself. */
-
- insn = PATTERN (insn);
- if (GET_CODE (insn) == PARALLEL)
- insn = XVECEXP (insn, 0, 0);
- if (GET_CODE (insn) == SET)
- insn = SET_SRC (insn);
- assert (GET_CODE (insn) == CALL);
- dwarf2out_args_size ("", INTVAL (XEXP (insn, 1)));
- return;
- }
-
- /* If only calls can throw, and we have a frame pointer,
- save up adjustments until we see the CALL_INSN. */
- else if (! asynchronous_exceptions
- && cfa_reg != STACK_POINTER_REGNUM)
- return;
-
- if (GET_CODE (insn) == BARRIER)
- {
- /* When we see a BARRIER, we know to reset args_size to 0. Usually
- the compiler will have already emitted a stack adjustment, but
- doesn't bother for calls to noreturn functions. */
-#ifdef STACK_GROWS_DOWNWARD
- offset = -args_size;
-#else
- offset = args_size;
-#endif
- }
- else if (GET_CODE (PATTERN (insn)) == SET)
- {
- rtx src, dest;
- enum rtx_code code;
-
- insn = PATTERN (insn);
- src = SET_SRC (insn);
- dest = SET_DEST (insn);
-
- if (dest == stack_pointer_rtx)
- {
- /* (set (reg sp) (plus (reg sp) (const_int))) */
- code = GET_CODE (src);
- if (! (code == PLUS || code == MINUS)
- || XEXP (src, 0) != stack_pointer_rtx
- || GET_CODE (XEXP (src, 1)) != CONST_INT)
- return;
-
- offset = INTVAL (XEXP (src, 1));
- }
- else if (GET_CODE (dest) == MEM)
- {
- /* (set (mem (pre_dec (reg sp))) (foo)) */
- src = XEXP (dest, 0);
- code = GET_CODE (src);
-
- if (! (code == PRE_DEC || code == PRE_INC)
- || XEXP (src, 0) != stack_pointer_rtx)
- return;
-
- offset = GET_MODE_SIZE (GET_MODE (dest));
- }
- else
- return;
-
- if (code == PLUS || code == PRE_INC)
- offset = -offset;
- }
- else
- return;
-
- if (offset == 0)
- return;
-
- if (cfa_reg == STACK_POINTER_REGNUM)
- cfa_offset += offset;
-
-#ifndef STACK_GROWS_DOWNWARD
- offset = -offset;
-#endif
- args_size += offset;
- if (args_size < 0)
- args_size = 0;
-
- label = dwarf2out_cfi_label ();
- dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
- dwarf2out_args_size (label, args_size);
-}
-
-/* Record call frame debugging information for INSN, which either
- sets SP or FP (adjusting how we calculate the frame address) or saves a
- register to the stack. If INSN is NULL_RTX, initialize our state. */
-
-void
-dwarf2out_frame_debug (insn)
- rtx insn;
-{
- char *label;
- rtx src, dest;
- long offset;
-
- /* A temporary register used in adjusting SP or setting up the store_reg. */
- static unsigned cfa_temp_reg;
- static long cfa_temp_value;
-
- if (insn == NULL_RTX)
- {
- /* Set up state for generating call frame debug info. */
- lookup_cfa (&cfa_reg, &cfa_offset);
- if (cfa_reg != DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM))
- abort ();
- cfa_reg = STACK_POINTER_REGNUM;
- cfa_store_reg = cfa_reg;
- cfa_store_offset = cfa_offset;
- cfa_temp_reg = -1;
- cfa_temp_value = 0;
- return;
- }
-
- if (! RTX_FRAME_RELATED_P (insn))
- {
- dwarf2out_stack_adjust (insn);
- return;
- }
-
- label = dwarf2out_cfi_label ();
-
- src = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
- if (src)
- insn = XEXP (src, 0);
- else
- insn = PATTERN (insn);
-
- /* Assume that in a PARALLEL prologue insn, only the first elt is
- significant. Currently this is true. */
- if (GET_CODE (insn) == PARALLEL)
- insn = XVECEXP (insn, 0, 0);
- if (GET_CODE (insn) != SET)
- abort ();
-
- src = SET_SRC (insn);
- dest = SET_DEST (insn);
-
- switch (GET_CODE (dest))
- {
- case REG:
- /* Update the CFA rule wrt SP or FP. Make sure src is
- relative to the current CFA register. */
- switch (GET_CODE (src))
- {
- /* Setting FP from SP. */
- case REG:
- if (cfa_reg != (unsigned) REGNO (src))
- abort ();
- if (REGNO (dest) != STACK_POINTER_REGNUM
- && !(frame_pointer_needed
- && REGNO (dest) == FRAME_POINTER_REGNUM))
- abort ();
- cfa_reg = REGNO (dest);
- break;
-
- case PLUS:
- case MINUS:
- if (dest == stack_pointer_rtx)
- {
- /* Adjusting SP. */
- switch (GET_CODE (XEXP (src, 1)))
- {
- case CONST_INT:
- offset = INTVAL (XEXP (src, 1));
- break;
- case REG:
- if ((unsigned) REGNO (XEXP (src, 1)) != cfa_temp_reg)
- abort ();
- offset = cfa_temp_value;
- break;
- default:
- abort ();
- }
-
- if (XEXP (src, 0) == frame_pointer_rtx)
- {
- /* Restoring SP from FP in the epilogue. */
- if (cfa_reg != (unsigned) FRAME_POINTER_REGNUM)
- abort ();
- cfa_reg = STACK_POINTER_REGNUM;
- }
- else if (XEXP (src, 0) != stack_pointer_rtx)
- abort ();
-
- if (GET_CODE (src) == PLUS)
- offset = -offset;
- if (cfa_reg == STACK_POINTER_REGNUM)
- cfa_offset += offset;
- if (cfa_store_reg == STACK_POINTER_REGNUM)
- cfa_store_offset += offset;
- }
- else if (dest == frame_pointer_rtx)
- {
- /* Either setting the FP from an offset of the SP,
- or adjusting the FP */
- if (! frame_pointer_needed
- || REGNO (dest) != FRAME_POINTER_REGNUM)
- abort ();
-
- if (XEXP (src, 0) == stack_pointer_rtx
- && GET_CODE (XEXP (src, 1)) == CONST_INT)
- {
- if (cfa_reg != STACK_POINTER_REGNUM)
- abort ();
- offset = INTVAL (XEXP (src, 1));
- if (GET_CODE (src) == PLUS)
- offset = -offset;
- cfa_offset += offset;
- cfa_reg = FRAME_POINTER_REGNUM;
- }
- else if (XEXP (src, 0) == frame_pointer_rtx
- && GET_CODE (XEXP (src, 1)) == CONST_INT)
- {
- if (cfa_reg != (unsigned) FRAME_POINTER_REGNUM)
- abort ();
- offset = INTVAL (XEXP (src, 1));
- if (GET_CODE (src) == PLUS)
- offset = -offset;
- cfa_offset += offset;
- }
-
- else
- abort();
- }
- else
- {
- if (GET_CODE (src) != PLUS
- || XEXP (src, 1) != stack_pointer_rtx)
- abort ();
- if (GET_CODE (XEXP (src, 0)) != REG
- || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg)
- abort ();
- if (cfa_reg != STACK_POINTER_REGNUM)
- abort ();
- cfa_store_reg = REGNO (dest);
- cfa_store_offset = cfa_offset - cfa_temp_value;
- }
- break;
-
- case CONST_INT:
- cfa_temp_reg = REGNO (dest);
- cfa_temp_value = INTVAL (src);
- break;
-
- case IOR:
- if (GET_CODE (XEXP (src, 0)) != REG
- || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg
- || (unsigned) REGNO (dest) != cfa_temp_reg
- || GET_CODE (XEXP (src, 1)) != CONST_INT)
- abort ();
- cfa_temp_value |= INTVAL (XEXP (src, 1));
- break;
-
- default:
- abort ();
- }
- dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
- break;
-
- case MEM:
- /* Saving a register to the stack. Make sure dest is relative to the
- CFA register. */
- if (GET_CODE (src) != REG)
- abort ();
- switch (GET_CODE (XEXP (dest, 0)))
- {
- /* With a push. */
- case PRE_INC:
- case PRE_DEC:
- offset = GET_MODE_SIZE (GET_MODE (dest));
- if (GET_CODE (XEXP (dest, 0)) == PRE_INC)
- offset = -offset;
-
- if (REGNO (XEXP (XEXP (dest, 0), 0)) != STACK_POINTER_REGNUM
- || cfa_store_reg != STACK_POINTER_REGNUM)
- abort ();
- cfa_store_offset += offset;
- if (cfa_reg == STACK_POINTER_REGNUM)
- cfa_offset = cfa_store_offset;
-
- offset = -cfa_store_offset;
- break;
-
- /* With an offset. */
- case PLUS:
- case MINUS:
- offset = INTVAL (XEXP (XEXP (dest, 0), 1));
- if (GET_CODE (src) == MINUS)
- offset = -offset;
-
- if (cfa_store_reg != (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
- abort ();
- offset -= cfa_store_offset;
- break;
-
- /* Without an offset. */
- case REG:
- if (cfa_store_reg != (unsigned) REGNO (XEXP (dest, 0)))
- abort();
- offset = -cfa_store_offset;
- break;
-
- default:
- abort ();
- }
- dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
- dwarf2out_reg_save (label, REGNO (src), offset);
- break;
-
- default:
- abort ();
- }
-}
-
/* Return the size of an unsigned LEB128 quantity. */
static inline unsigned long
@@ -1504,379 +633,6 @@ output_sleb128 (value)
fprintf (asm_out_file, "\t%s SLEB128 %ld", ASM_COMMENT_START, save_value);
}
-/* Output a Call Frame Information opcode and its operand(s). */
-
-static void
-output_cfi (cfi, fde)
- register dw_cfi_ref cfi;
- register dw_fde_ref fde;
-{
- if (cfi->dw_cfi_opc == DW_CFA_advance_loc)
- {
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
- cfi->dw_cfi_opc
- | (cfi->dw_cfi_oprnd1.dw_cfi_offset & 0x3f));
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_CFA_advance_loc 0x%lx",
- ASM_COMMENT_START, cfi->dw_cfi_oprnd1.dw_cfi_offset);
- fputc ('\n', asm_out_file);
- }
-
- else if (cfi->dw_cfi_opc == DW_CFA_offset)
- {
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
- cfi->dw_cfi_opc
- | (cfi->dw_cfi_oprnd1.dw_cfi_reg_num & 0x3f));
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_CFA_offset, column 0x%lx",
- ASM_COMMENT_START, cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
-
- fputc ('\n', asm_out_file);
- output_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_offset);
- fputc ('\n', asm_out_file);
- }
- else if (cfi->dw_cfi_opc == DW_CFA_restore)
- {
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
- cfi->dw_cfi_opc
- | (cfi->dw_cfi_oprnd1.dw_cfi_reg_num & 0x3f));
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s DW_CFA_restore, column 0x%lx",
- ASM_COMMENT_START, cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
-
- fputc ('\n', asm_out_file);
- }
- else
- {
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, cfi->dw_cfi_opc);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s %s", ASM_COMMENT_START,
- dwarf_cfi_name (cfi->dw_cfi_opc));
-
- fputc ('\n', asm_out_file);
- switch (cfi->dw_cfi_opc)
- {
- case DW_CFA_set_loc:
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, cfi->dw_cfi_oprnd1.dw_cfi_addr);
- fputc ('\n', asm_out_file);
- break;
- case DW_CFA_advance_loc1:
- ASM_OUTPUT_DWARF_DELTA1 (asm_out_file,
- cfi->dw_cfi_oprnd1.dw_cfi_addr,
- fde->dw_fde_current_label);
- fputc ('\n', asm_out_file);
- fde->dw_fde_current_label = cfi->dw_cfi_oprnd1.dw_cfi_addr;
- break;
- case DW_CFA_advance_loc2:
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file,
- cfi->dw_cfi_oprnd1.dw_cfi_addr,
- fde->dw_fde_current_label);
- fputc ('\n', asm_out_file);
- fde->dw_fde_current_label = cfi->dw_cfi_oprnd1.dw_cfi_addr;
- break;
- case DW_CFA_advance_loc4:
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file,
- cfi->dw_cfi_oprnd1.dw_cfi_addr,
- fde->dw_fde_current_label);
- fputc ('\n', asm_out_file);
- fde->dw_fde_current_label = cfi->dw_cfi_oprnd1.dw_cfi_addr;
- break;
-#ifdef MIPS_DEBUGGING_INFO
- case DW_CFA_MIPS_advance_loc8:
- /* TODO: not currently implemented. */
- abort ();
- break;
-#endif
- case DW_CFA_offset_extended:
- case DW_CFA_def_cfa:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
- output_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_offset);
- fputc ('\n', asm_out_file);
- break;
- case DW_CFA_restore_extended:
- case DW_CFA_undefined:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
- break;
- case DW_CFA_same_value:
- case DW_CFA_def_cfa_register:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
- break;
- case DW_CFA_register:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
- output_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_reg_num);
- fputc ('\n', asm_out_file);
- break;
- case DW_CFA_def_cfa_offset:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_offset);
- fputc ('\n', asm_out_file);
- break;
- case DW_CFA_GNU_window_save:
- break;
- case DW_CFA_GNU_args_size:
- output_uleb128 (cfi->dw_cfi_oprnd1.dw_cfi_offset);
- fputc ('\n', asm_out_file);
- break;
- default:
- break;
- }
- }
-}
-
-#if !defined (EH_FRAME_SECTION)
-#if defined (EH_FRAME_SECTION_ASM_OP)
-#define EH_FRAME_SECTION() eh_frame_section();
-#else
-#if defined (ASM_OUTPUT_SECTION_NAME)
-#define EH_FRAME_SECTION() \
- do { \
- named_section (NULL_TREE, ".eh_frame", 0); \
- } while (0)
-#endif
-#endif
-#endif
-
-/* If we aren't using crtstuff to run ctors, don't use it for EH. */
-#if !defined (HAS_INIT_SECTION) && !defined (INIT_SECTION_ASM_OP)
-#undef EH_FRAME_SECTION
-#endif
-
-/* Output the call frame information used to used to record information
- that relates to calculating the frame pointer, and records the
- location of saved registers. */
-
-static void
-output_call_frame_info (for_eh)
- int for_eh;
-{
- register unsigned long i;
- register dw_fde_ref fde;
- register dw_cfi_ref cfi;
- char l1[20], l2[20];
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- char ld[20];
-#endif
-
- /* Do we want to include a pointer to the exception table? */
- int eh_ptr = for_eh && exception_table_p ();
-
- fputc ('\n', asm_out_file);
-
- /* We're going to be generating comments, so turn on app. */
- if (flag_debug_asm)
- app_enable ();
-
- if (for_eh)
- {
-#ifdef EH_FRAME_SECTION
- EH_FRAME_SECTION ();
-#else
- tree label = get_file_function_name ('F');
-
- force_data_section ();
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
- ASM_GLOBALIZE_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
- ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
-#endif
- assemble_label ("__FRAME_BEGIN__");
- }
- else
- ASM_OUTPUT_SECTION (asm_out_file, FRAME_SECTION);
-
- /* Output the CIE. */
- ASM_GENERATE_INTERNAL_LABEL (l1, CIE_AFTER_SIZE_LABEL, for_eh);
- ASM_GENERATE_INTERNAL_LABEL (l2, CIE_END_LABEL, for_eh);
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- ASM_GENERATE_INTERNAL_LABEL (ld, CIE_LENGTH_LABEL, for_eh);
- if (for_eh)
- ASM_OUTPUT_DWARF_OFFSET4 (asm_out_file, ld);
- else
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, ld);
-#else
- if (for_eh)
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, l2, l1);
- else
- ASM_OUTPUT_DWARF_DELTA (asm_out_file, l2, l1);
-#endif
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s Length of Common Information Entry",
- ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_LABEL (asm_out_file, l1);
-
- if (for_eh)
- /* Now that the CIE pointer is PC-relative for EH,
- use 0 to identify the CIE. */
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- else
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, DW_CIE_ID);
-
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE Identifier Tag", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- if (! for_eh && DWARF_OFFSET_SIZE == 8)
- {
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, DW_CIE_ID);
- fputc ('\n', asm_out_file);
- }
-
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_CIE_VERSION);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE Version", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- if (eh_ptr)
- {
- /* The CIE contains a pointer to the exception region info for the
- frame. Make the augmentation string three bytes (including the
- trailing null) so the pointer is 4-byte aligned. The Solaris ld
- can't handle unaligned relocs. */
- if (flag_debug_asm)
- {
- ASM_OUTPUT_DWARF_STRING (asm_out_file, "eh");
- fprintf (asm_out_file, "\t%s CIE Augmentation", ASM_COMMENT_START);
- }
- else
- {
- ASM_OUTPUT_ASCII (asm_out_file, "eh", 3);
- }
- fputc ('\n', asm_out_file);
-
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, "__EXCEPTION_TABLE__");
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s pointer to exception region info",
- ASM_COMMENT_START);
- }
- else
- {
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE Augmentation (none)",
- ASM_COMMENT_START);
- }
-
- fputc ('\n', asm_out_file);
- output_uleb128 (1);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (CIE Code Alignment Factor)");
-
- fputc ('\n', asm_out_file);
- output_sleb128 (DWARF_CIE_DATA_ALIGNMENT);
- if (flag_debug_asm)
- fprintf (asm_out_file, " (CIE Data Alignment Factor)");
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DWARF_FRAME_RETURN_COLUMN);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE RA Column", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
-
- for (cfi = cie_cfi_head; cfi != NULL; cfi = cfi->dw_cfi_next)
- output_cfi (cfi, NULL);
-
- /* Pad the CIE out to an address sized boundary. */
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
- ASM_OUTPUT_LABEL (asm_out_file, l2);
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL (asm_out_file, ld, l2, l1);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s CIE Length Symbol", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
-#endif
-
- /* Loop through all of the FDE's. */
- for (i = 0; i < fde_table_in_use; ++i)
- {
- fde = &fde_table[i];
-
- ASM_GENERATE_INTERNAL_LABEL (l1, FDE_AFTER_SIZE_LABEL, for_eh + i*2);
- ASM_GENERATE_INTERNAL_LABEL (l2, FDE_END_LABEL, for_eh + i*2);
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- ASM_GENERATE_INTERNAL_LABEL (ld, FDE_LENGTH_LABEL, for_eh + i*2);
- if (for_eh)
- ASM_OUTPUT_DWARF_OFFSET4 (asm_out_file, ld);
- else
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, ld);
-#else
- if (for_eh)
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, l2, l1);
- else
- ASM_OUTPUT_DWARF_DELTA (asm_out_file, l2, l1);
-#endif
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE Length", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_LABEL (asm_out_file, l1);
-
- /* ??? This always emits a 4 byte offset when for_eh is true, but it
- emits a target dependent sized offset when for_eh is not true.
- This inconsistency may confuse gdb. The only case where we need a
- non-4 byte offset is for the Irix6 N64 ABI, so we may lose SGI
- compatibility if we emit a 4 byte offset. We need a 4 byte offset
- though in order to be compatible with the dwarf_fde struct in frame.c.
- If the for_eh case is changed, then the struct in frame.c has
- to be adjusted appropriately. */
- if (for_eh)
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, l1, "__FRAME_BEGIN__");
- else
- ASM_OUTPUT_DWARF_OFFSET (asm_out_file, stripattributes (FRAME_SECTION));
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE CIE offset", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, fde->dw_fde_begin);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE initial location", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file,
- fde->dw_fde_end, fde->dw_fde_begin);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE address range", ASM_COMMENT_START);
-
- fputc ('\n', asm_out_file);
-
- /* Loop through the Call Frame Instructions associated with
- this FDE. */
- fde->dw_fde_current_label = fde->dw_fde_begin;
- for (cfi = fde->dw_fde_cfi; cfi != NULL; cfi = cfi->dw_cfi_next)
- output_cfi (cfi, fde);
-
- /* Pad the FDE out to an address sized boundary. */
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
- ASM_OUTPUT_LABEL (asm_out_file, l2);
-#ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL
- ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL (asm_out_file, ld, l2, l1);
- if (flag_debug_asm)
- fprintf (asm_out_file, "\t%s FDE Length Symbol", ASM_COMMENT_START);
- fputc ('\n', asm_out_file);
-#endif
- }
-#ifndef EH_FRAME_SECTION
- if (for_eh)
- {
- /* Emit terminating zero for table. */
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- fputc ('\n', asm_out_file);
- }
-#endif
-#ifdef MIPS_DEBUGGING_INFO
- /* Work around Irix 6 assembler bug whereby labels at the end of a section
- get a value of 0. Putting .align 0 after the label fixes it. */
- ASM_OUTPUT_ALIGN (asm_out_file, 0);
-#endif
-
- /* Turn off app to make assembly quicker. */
- if (flag_debug_asm)
- app_disable ();
-}
-
/* Output a marker (i.e. a label) for the beginning of a function, before
the prologue. */
@@ -1933,42 +689,6 @@ dwarf2out_end_epilogue ()
fde->dw_fde_end = xstrdup (label);
}
-void
-dwarf2out_frame_init ()
-{
- /* Allocate the initial hunk of the fde_table. */
- fde_table
- = (dw_fde_ref) xmalloc (FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
- zero_memory ((char *) fde_table, FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
- fde_table_allocated = FDE_TABLE_INCREMENT;
- fde_table_in_use = 0;
-
- /* Generate the CFA instructions common to all FDE's. Do it now for the
- sake of lookup_cfa. */
-
-#ifdef DWARF2_UNWIND_INFO
- /* On entry, the Canonical Frame Address is at SP. */
- dwarf2out_def_cfa (NULL, STACK_POINTER_REGNUM, INCOMING_FRAME_SP_OFFSET);
- initial_return_save (INCOMING_RETURN_ADDR_RTX);
-#endif
-}
-
-void
-dwarf2out_frame_finish ()
-{
- /* Output call frame information. */
-#ifdef MIPS_DEBUGGING_INFO
- if (write_symbols == DWARF2_DEBUG)
- output_call_frame_info (0);
- if (flag_exceptions && ! exceptions_via_longjmp)
- output_call_frame_info (1);
-#else
- if (write_symbols == DWARF2_DEBUG
- || (flag_exceptions && ! exceptions_via_longjmp))
- output_call_frame_info (1);
-#endif
-}
-
#endif /* .debug_frame support */
/* And now, the support for symbolic debugging information. */
@@ -2494,7 +1214,6 @@ static void output_aranges (void);
static void output_line_info (void);
static int is_body_block (tree);
static dw_die_ref base_type_die (tree);
-static tree root_type (tree);
static int is_base_type (tree);
static dw_die_ref modified_type_die (tree, int, int, dw_die_ref);
static int type_is_enum (tree);
@@ -6189,36 +4908,6 @@ base_type_die (type)
return base_type_result;
}
-/* Given a pointer to an arbitrary ..._TYPE tree node, return a pointer to
- the Dwarf "root" type for the given input type. The Dwarf "root" type of
- a given type is generally the same as the given type, except that if the
- given type is a pointer or reference type, then the root type of the given
- type is the root type of the "basis" type for the pointer or reference
- type. (This definition of the "root" type is recursive.) Also, the root
- type of a `const' qualified type or a `volatile' qualified type is the
- root type of the given type without the qualifiers. */
-
-static tree
-root_type (type)
- register tree type;
-{
- if (TREE_CODE (type) == ERROR_MARK)
- return error_mark_node;
-
- switch (TREE_CODE (type))
- {
- case ERROR_MARK:
- return error_mark_node;
-
- case POINTER_TYPE:
- case REFERENCE_TYPE:
- return type_main_variant (root_type (TREE_TYPE (type)));
-
- default:
- return type_main_variant (type);
- }
-}
-
/* Given a pointer to an arbitrary ..._TYPE tree node, return non-zero if the
given input type is a Dwarf "fundamental" type. Otherwise return null. */
@@ -6838,13 +5527,7 @@ add_data_member_location_attribute (die, decl)
is already on the stack, so we can specify a structure field address
by using DW_OP_plus_uconst. */
-#ifdef MIPS_DEBUGGING_INFO
- /* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst operator
- correctly. It works only if we leave the offset on the stack. */
- op = DW_OP_constu;
-#else
op = DW_OP_plus_uconst;
-#endif
loc_descr = new_loc_descr (op, offset, 0);
add_AT_loc (die, DW_AT_data_member_location, loc_descr);
@@ -7217,9 +5900,7 @@ add_subscript_info (type_die, type)
register dw_die_ref type_die;
register tree type;
{
-#ifndef MIPS_DEBUGGING_INFO
register unsigned dimension_number;
-#endif
register tree lower, upper;
register dw_die_ref subrange_die;
@@ -7232,16 +5913,10 @@ add_subscript_info (type_die, type)
arrays and a multidimensional array in C) but for other source languages
(e.g. Ada) we probably shouldn't do this. */
- /* ??? The SGI dwarf reader fails for multidimensional arrays with a
- const enum type. E.g. const enum machine_mode insn_operand_mode[2][10].
- We work around this by disabling this feature. See also
- gen_array_type_die. */
-#ifndef MIPS_DEBUGGING_INFO
for (dimension_number = 0;
TREE_CODE (type) == ARRAY_TYPE;
type = TREE_TYPE (type), dimension_number++)
{
-#endif
register tree domain = TYPE_DOMAIN (type);
/* Arrays come in three flavors: Unspecified bounds, fixed bounds,
@@ -7288,9 +5963,7 @@ add_subscript_info (type_die, type)
{;}
-#ifndef MIPS_DEBUGGING_INFO
}
-#endif
}
static void
@@ -7761,13 +6434,6 @@ gen_array_type_die (type, context_die)
register dw_die_ref array_die;
register tree element_type;
- /* ??? The SGI dwarf reader fails for array of array of enum types unless
- the inner array type comes before the outer array type. Thus we must
- call gen_type_die before we call new_die. See below also. */
-#ifdef MIPS_DEBUGGING_INFO
- gen_type_die (TREE_TYPE (type), context_die);
-#endif
-
array_die = new_die (DW_TAG_array_type, scope_die);
#if 0
@@ -7781,13 +6447,6 @@ gen_array_type_die (type, context_die)
add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_row_major);
#endif
-#ifdef MIPS_DEBUGGING_INFO
- /* The SGI compilers handle arrays of unknown bound by setting
- AT_declaration and not emitting any subrange DIEs. */
- if (! TYPE_DOMAIN (type))
- add_AT_unsigned (array_die, DW_AT_declaration, 1);
- else
-#endif
add_subscript_info (array_die, type);
equate_type_number_to_die (type, array_die);
@@ -7795,16 +6454,10 @@ gen_array_type_die (type, context_die)
/* Add representation of the type of the elements of this array type. */
element_type = TREE_TYPE (type);
- /* ??? The SGI dwarf reader fails for multidimensional arrays with a
- const enum type. E.g. const enum machine_mode insn_operand_mode[2][10].
- We work around this by disabling this feature. See also
- add_subscript_info. */
-#ifndef MIPS_DEBUGGING_INFO
while (TREE_CODE (element_type) == ARRAY_TYPE)
element_type = TREE_TYPE (element_type);
gen_type_die (element_type, context_die);
-#endif
add_type_attribute (array_die, element_type, 0, 0, context_die);
}
@@ -8288,10 +6941,6 @@ gen_subprogram_die (decl, context_die)
add_pubname (decl, subr_die);
add_arange (decl, subr_die);
-#ifdef MIPS_DEBUGGING_INFO
- /* Add a reference to the FDE for this routine. */
- add_AT_fde_ref (subr_die, DW_AT_MIPS_fde, current_funcdef_fde);
-#endif
/* Define the "frame base" location for this routine. We use the
frame pointer or stack pointer registers, since the RTL for local
diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h
index 8a94b0e..d499480 100755
--- a/gcc/dwarf2out.h
+++ b/gcc/dwarf2out.h
@@ -32,9 +32,6 @@ extern void dwarf2out_end_block (unsigned);
extern void dwarf2out_label (rtx);
extern void dwarf2out_decl (tree);
extern void dwarf2out_line (char *, unsigned);
-extern void dwarf2out_frame_init (void);
-extern void dwarf2out_frame_debug (rtx);
-extern void dwarf2out_frame_finish (void);
extern void debug_dwarf (void);
struct die_struct;
diff --git a/gcc/except.h b/gcc/except.h
index ec69912..3ea0584 100755
--- a/gcc/except.h
+++ b/gcc/except.h
@@ -380,11 +380,9 @@ extern void expand_fixup_region_end (tree);
/* Various hooks for the DWARF 2 __throw routine. */
void expand_builtin_unwind_init (void);
-rtx expand_builtin_dwarf_fp_regnum (void);
#ifdef TREE_CODE
rtx expand_builtin_frob_return_addr (tree);
rtx expand_builtin_extract_return_addr (tree);
-rtx expand_builtin_dwarf_reg_size (tree, rtx);
void expand_builtin_eh_return (tree, tree, tree);
#endif
void expand_eh_return (void);
diff --git a/gcc/expr.c b/gcc/expr.c
index 127ae3a..aa5d303 100755
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -152,7 +152,6 @@ static rtx expand_builtin (tree, rtx, rtx,
enum machine_mode, int);
static int apply_args_size (void);
static int apply_result_size (void);
-static rtx result_vector (int, rtx);
static rtx expand_builtin_apply_args (void);
static rtx expand_builtin_apply (rtx, rtx, rtx);
static void expand_builtin_return (rtx);
@@ -8397,12 +8396,6 @@ expand_builtin(tree exp, rtx target, rtx subtarget, enum machine_mode mode, int
return const0_rtx;
case BUILT_IN_DWARF_CFA:
return virtual_cfa_rtx;
-#ifdef DWARF2_UNWIND_INFO
- case BUILT_IN_DWARF_FP_REGNUM:
- return expand_builtin_dwarf_fp_regnum();
- case BUILT_IN_DWARF_REG_SIZE:
- return expand_builtin_dwarf_reg_size(TREE_VALUE(arglist), target);
-#endif
case BUILT_IN_FROB_RETURN_ADDR:
return expand_builtin_frob_return_addr(TREE_VALUE(arglist));
case BUILT_IN_EXTRACT_RETURN_ADDR:
diff --git a/gcc/final.c b/gcc/final.c
index 9be490d..2645ad1 100755
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -72,7 +72,7 @@ Boston, MA 02111-1307, USA. */
extern struct obstack *rtl_obstack;
/* END CYGNUS LOCAL */
-#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
+#if defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
#endif
@@ -1083,10 +1083,8 @@ final_start_function (first, file, optimize)
int optimize;
{
block_depth = 0;
-
this_is_asm_operands = 0;
-
/* Initial line number is supposed to be output
before the function's prologue and label
so that the function's address will not appear to be
@@ -1095,23 +1093,15 @@ final_start_function (first, file, optimize)
last_linenum = high_block_linenum = high_function_linenum
= NOTE_LINE_NUMBER (first);
-#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
+#if defined (DWARF2_DEBUGGING_INFO)
/* Output DWARF definition of the function. */
if (dwarf2out_do_frame ())
dwarf2out_begin_prologue ();
#endif
- /* But only output line number for other debug info types if -g2
- or better. */
if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED)
output_source_line (file, first);
-
-#if defined (DWARF2_UNWIND_INFO) && defined (HAVE_prologue)
- if (dwarf2out_do_frame ())
- dwarf2out_frame_debug (NULL_RTX);
-#endif
-
#ifdef FUNCTION_PROLOGUE
/* First output the function prologue: code to set up the stack frame. */
FUNCTION_PROLOGUE (file, get_frame_size ());
@@ -1142,7 +1132,7 @@ final_end_function (first, file, optimize)
#endif
-#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
+#if defined (DWARF2_DEBUGGING_INFO)
if (dwarf2out_do_frame ())
dwarf2out_end_epilogue ();
#endif
@@ -1443,12 +1433,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
break;
case BARRIER:
-#if defined (DWARF2_UNWIND_INFO) && !defined (ACCUMULATE_OUTGOING_ARGS)
- /* If we push arguments, we need to check all insns for stack
- adjustments. */
- if (dwarf2out_do_frame ())
- dwarf2out_frame_debug (insn);
-#endif
break;
case CODE_LABEL:
@@ -1994,11 +1978,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
debug_insn = insn;
-#if defined (DWARF2_UNWIND_INFO) && !defined (ACCUMULATE_OUTGOING_ARGS)
- /* If we push arguments, we want to know where the calls are. */
- if (GET_CODE (insn) == CALL_INSN && dwarf2out_do_frame ())
- dwarf2out_frame_debug (insn);
-#endif
/* If the proper template needs to be chosen by some C code,
run that code and get the real template. */
@@ -2046,21 +2025,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
output_asm_insn (template, recog_operand);
-#if defined (DWARF2_UNWIND_INFO)
-#if !defined (ACCUMULATE_OUTGOING_ARGS)
- /* If we push arguments, we need to check all insns for stack
- adjustments. */
- if (GET_CODE (insn) == INSN && dwarf2out_do_frame ())
- dwarf2out_frame_debug (insn);
-#else
-#if defined (HAVE_prologue)
- /* If this insn is part of the prologue, emit DWARF v2
- call frame info. */
- if (RTX_FRAME_RELATED_P (insn) && dwarf2out_do_frame ())
- dwarf2out_frame_debug (insn);
-#endif
-#endif
-#endif
#if 0
/* It's not at all clear why we did this and doing so interferes
diff --git a/gcc/output.h b/gcc/output.h
index 9a7e528..63a8f99 100755
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -152,10 +152,6 @@ extern void readonly_data_section (void);
/* Determine if we're in the text section. */
extern int in_text_section (void);
-#ifdef EH_FRAME_SECTION_ASM_OP
-extern void eh_frame_section (void);
-#endif
-
#ifdef TREE_CODE
/* Tell assembler to change to section NAME for DECL.
If DECL is NULL, just switch to section NAME.
diff --git a/gcc/real.c b/gcc/real.c
index 9b29d0a..456edda 100755
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -207,7 +207,6 @@ static void emovz (uint16_t *, uint16_t *);
static void einan (uint16_t *);
static int eiisnan (uint16_t *);
static int eiisneg (uint16_t *);
-static int eiisinf (uint16_t *);
static int ecmpm (uint16_t *, uint16_t *);
static void eshdn1 (uint16_t *);
static void eshup1 (uint16_t *);
@@ -1426,22 +1425,6 @@ eiisneg (x)
return x[0] != 0;
}
-
-/* Return nonzero if exploded e-type X is infinite. */
-
-static int
-eiisinf (x)
- uint16_t x[];
-{
-
- if (eiisnan (x))
- return (0);
- if ((x[E] & 0x7fff) == 0x7fff)
- return (1);
- return (0);
-}
-
-
/* Compare significands of numbers in internal exploded e-type format.
Guard words are included in the comparison.
diff --git a/gcc/toplev.c b/gcc/toplev.c
index adb18fb..a01be8f 100755
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -42,7 +42,7 @@
#include "toplev.h"
#include "expr.h"
-#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
+#if defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
#endif
@@ -2144,22 +2144,8 @@ compile_file(char *name)
warning("-ffunction-sections may affect debugging on some targets.");
#endif
- /* ??? Note: There used to be a conditional here
- to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined.
- This was to guarantee separation between gcc_compiled. and
- the first function, for the sake of dbx on Suns.
- However, having the extra zero here confused the Emacs
- code for unexec, and might confuse other programs too.
- Therefore, I took out that change.
- In future versions we should find another way to solve
- that dbx problem. -- rms, 23 May 93. */
-
- /* If dbx symbol table desired, initialize writing it
- and output the predefined types. */
-#ifdef DWARF2_UNWIND_INFO
- if (dwarf2out_do_frame())
- dwarf2out_frame_init();
-#endif
+ /* Initialize DWARF-2. */
+
#ifdef DWARF2_DEBUGGING_INFO
if (write_symbols == DWARF2_DEBUG)
TIMEVAR(symout_time, dwarf2out_init(asm_out_file, main_input_filename));
@@ -2364,10 +2350,6 @@ compile_file(char *name)
weak_finish();
-#ifdef DWARF2_UNWIND_INFO
- if (dwarf2out_do_frame())
- dwarf2out_frame_finish();
-#endif
#ifdef DWARF2_DEBUGGING_INFO
if (write_symbols == DWARF2_DEBUG)
@@ -3965,11 +3947,7 @@ larger_than_lose:;
if (exceptions_via_longjmp == 2)
{
-#ifdef DWARF2_UNWIND_INFO
- exceptions_via_longjmp = !DWARF2_UNWIND_INFO;
-#else
exceptions_via_longjmp = 1;
-#endif
}
/* Unrolling all loops implies that standard loop unrolling must also
diff --git a/gcc/tree.h b/gcc/tree.h
index 7bb35a0..e2a1c4a 100755
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1986,35 +1986,6 @@ extern tree invert_truthvalue (tree);
extern int dwarf2out_do_frame (void);
-/* Generate a new label for the CFI info to refer to. */
-
-extern char *dwarf2out_cfi_label (void);
-
-/* Entry point to update the canonical frame address (CFA). */
-
-extern void dwarf2out_def_cfa (char *, unsigned, long);
-
-/* Add the CFI for saving a register window. */
-
-extern void dwarf2out_window_save (char *);
-
-/* Add a CFI to update the running total of the size of arguments pushed
- onto the stack. */
-
-extern void dwarf2out_args_size (char *, long);
-
-/* Entry point for saving a register to the stack. */
-
-extern void dwarf2out_reg_save (char *, unsigned, long);
-
-/* Entry point for saving the return address in the stack. */
-
-extern void dwarf2out_return_save (char *, long);
-
-/* Entry point for saving the return address in a register. */
-
-extern void dwarf2out_return_reg (char *, unsigned);
-
/* Output a marker (i.e. a label) for the beginning of a function, before
the prologue. */
@@ -2281,35 +2252,6 @@ extern tree get_file_function_name (int);
extern int dwarf2out_do_frame (void);
-/* Generate a new label for the CFI info to refer to. */
-
-extern char *dwarf2out_cfi_label (void);
-
-/* Entry point to update the canonical frame address (CFA). */
-
-extern void dwarf2out_def_cfa (char *, unsigned, long);
-
-/* Add the CFI for saving a register window. */
-
-extern void dwarf2out_window_save (char *);
-
-/* Add a CFI to update the running total of the size of arguments pushed
- onto the stack. */
-
-extern void dwarf2out_args_size (char *, long);
-
-/* Entry point for saving a register to the stack. */
-
-extern void dwarf2out_reg_save (char *, unsigned, long);
-
-/* Entry point for saving the return address in the stack. */
-
-extern void dwarf2out_return_save (char *, long);
-
-/* Entry point for saving the return address in a register. */
-
-extern void dwarf2out_return_reg (char *, unsigned);
-
/* Output a marker (i.e. a label) for the beginning of a function, before
the prologue. */
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 3f51b3a..b311884 100755
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -156,9 +156,6 @@ static enum in_section { no_section, in_text, in_data, in_named
#ifdef BSS_SECTION_ASM_OP
, in_bss
#endif
-#ifdef EH_FRAME_SECTION_ASM_OP
- , in_eh_frame
-#endif
#ifdef EXTRA_SECTIONS
, EXTRA_SECTIONS
#endif
@@ -371,18 +368,6 @@ asm_output_aligned_bss (file, decl, name, size, align)
#endif /* BSS_SECTION_ASM_OP */
-#ifdef EH_FRAME_SECTION_ASM_OP
-void
-eh_frame_section ()
-{
- if (in_section != in_eh_frame)
- {
- fprintf (asm_out_file, "%s\n", EH_FRAME_SECTION_ASM_OP);
- in_section = in_eh_frame;
- }
-}
-#endif
-
/* Switch to the section for function DECL.
If DECL is NULL_TREE, switch to the text section.