Deleted Added
full compact
2c2
< Copyright (C) 1992, 93, 95, 96, 97, 1998 Free Software Foundation, Inc.
---
> Copyright (C) 1992, 93, 95-98, 1999 Free Software Foundation, Inc.
21c21,22
< the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
---
> the Free Software Foundation, 59 Temple Place - Suite 330,
> Boston, MA 02111-1307, USA. */
74,77d74
< #ifndef __GNUC__
< #define inline
< #endif
<
348a346,355
> /* ??? This macro takes an RTX in dwarfout.c and a string in dwarf2out.c.
> We resolve the conflict by creating a new macro ASM_OUTPUT_DWARF2_ADDR_CONST
> for ports that want to support both DWARF1 and DWARF2. This needs a better
> solution. See also the comments in sparc/sp64-elf.h. */
> #ifdef ASM_OUTPUT_DWARF2_ADDR_CONST
> #undef ASM_OUTPUT_DWARF_ADDR_CONST
> #define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,ADDR) \
> ASM_OUTPUT_DWARF2_ADDR_CONST (FILE, ADDR)
> #endif
>
634a642,644
> /* Initialize last_end to be larger than any possible
> DWARF_FRAME_REGNUM. */
> int last_end = 0x7fffffff;
637,638c647
< size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
< for (; n_ranges--; )
---
> do
640,642c649,653
< if ((DWARF_FRAME_REGNUM (ranges[n_ranges].end)
< - DWARF_FRAME_REGNUM (ranges[n_ranges].beg))
< != ranges[n_ranges].end - ranges[n_ranges].beg)
---
> 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)
644c655,656
< if (DWARF_FRAME_REGNUM (ranges[n_ranges].beg) >= size)
---
> last_end = end;
> if (end - beg != ranges[n_ranges].end - ranges[n_ranges].beg)
646d657
< size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
648,649c659
< build_int_2 (DWARF_FRAME_REGNUM
< (ranges[n_ranges].end), 0)));
---
> build_int_2 (end, 0)));
652a663
> while (--n_ranges >= 0);
1029c1040
< unsigned reg = -1;
---
> unsigned int reg = (unsigned int) -1;
1178c1189,1195
< /* Record call frame debugging information for INSN, which either
---
> /* A temporary register used in adjusting SP or setting up the store_reg. */
> static unsigned cfa_temp_reg;
>
> /* A temporary value used in adjusting SP or setting up the store_reg. */
> static long cfa_temp_value;
>
> /* Record call frame debugging information for an expression, which either
1180c1197
< register to the stack. If INSN is NULL_RTX, initialize our state. */
---
> register to the stack. */
1182,1184c1199,1202
< void
< dwarf2out_frame_debug (insn)
< rtx insn;
---
> static void
> dwarf2out_frame_debug_expr (expr, label)
> rtx expr;
> char *label;
1186d1203
< char *label;
1188a1206,1211
>
> /* If RTX_FRAME_RELATED_P is set on a PARALLEL, process each member of
> the PARALLEL independantly. The first element is always processed if
> it is a SET. This is for backward compatability. Other elements
> are processed only if they are SETs and the RTX_FRAME_RELATED_P
> flag is set in them. */
1190,1192c1213,1216
< /* A temporary register used in adjusting SP or setting up the store_reg. */
< static unsigned cfa_temp_reg;
< static long cfa_temp_value;
---
> if (GET_CODE (expr) == PARALLEL)
> {
> int par_index;
> int limit = XVECLEN (expr, 0);
1194,1204c1218,1225
< 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;
---
> for (par_index = 0; par_index < limit; par_index++)
> {
> rtx x = XVECEXP (expr, 0, par_index);
>
> if (GET_CODE (x) == SET &&
> (RTX_FRAME_RELATED_P (x) || par_index == 0))
> dwarf2out_frame_debug_expr (x, label);
> }
1207,1221c1228,1229
<
< if (! RTX_FRAME_RELATED_P (insn))
< {
< dwarf2out_stack_adjust (insn);
< return;
< }
<
< label = dwarf2out_cfi_label ();
<
< 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)
---
>
> if (GET_CODE (expr) != SET)
1224,1225c1232,1233
< src = SET_SRC (insn);
< dest = SET_DEST (insn);
---
> src = SET_SRC (expr);
> dest = SET_DEST (expr);
1231c1239
< relative to the current CFA register. */
---
> relative to the current CFA register. */
1233,1243c1241,1251
< {
< /* Setting FP from SP. */
< case REG:
< if (cfa_reg != REGNO (src))
< abort ();
< if (REGNO (dest) != STACK_POINTER_REGNUM
< && !(frame_pointer_needed
< && REGNO (dest) == HARD_FRAME_POINTER_REGNUM))
< abort ();
< cfa_reg = REGNO (dest);
< break;
---
> {
> /* Setting FP from SP. */
> case REG:
> if (cfa_reg != (unsigned) REGNO (src))
> abort ();
> if (REGNO (dest) != STACK_POINTER_REGNUM
> && !(frame_pointer_needed
> && REGNO (dest) == HARD_FRAME_POINTER_REGNUM))
> abort ();
> cfa_reg = REGNO (dest);
> break;
1245,1262c1253,1270
< 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 (REGNO (XEXP (src, 1)) != cfa_temp_reg)
< abort ();
< offset = cfa_temp_value;
< break;
< default:
< abort ();
< }
---
> 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 ();
> }
1264,1272c1272,1280
< if (XEXP (src, 0) == hard_frame_pointer_rtx)
< {
< /* Restoring SP from FP in the epilogue. */
< if (cfa_reg != HARD_FRAME_POINTER_REGNUM)
< abort ();
< cfa_reg = STACK_POINTER_REGNUM;
< }
< else if (XEXP (src, 0) != stack_pointer_rtx)
< abort ();
---
> if (XEXP (src, 0) == hard_frame_pointer_rtx)
> {
> /* Restoring SP from FP in the epilogue. */
> if (cfa_reg != (unsigned) HARD_FRAME_POINTER_REGNUM)
> abort ();
> cfa_reg = STACK_POINTER_REGNUM;
> }
> else if (XEXP (src, 0) != stack_pointer_rtx)
> abort ();
1274,1280c1282,1288
< 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;
< }
---
> 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;
> }
1283,1287c1291,1295
< /* Either setting the FP from an offset of the SP,
< or adjusting the FP */
< if (! frame_pointer_needed
< || REGNO (dest) != HARD_FRAME_POINTER_REGNUM)
< abort ();
---
> /* Either setting the FP from an offset of the SP,
> or adjusting the FP */
> if (! frame_pointer_needed
> || REGNO (dest) != HARD_FRAME_POINTER_REGNUM)
> abort ();
1289,1309c1297,1317
< 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 = HARD_FRAME_POINTER_REGNUM;
< }
< else if (XEXP (src, 0) == hard_frame_pointer_rtx
< && GET_CODE (XEXP (src, 1)) == CONST_INT)
< {
< if (cfa_reg != HARD_FRAME_POINTER_REGNUM)
< abort ();
< offset = INTVAL (XEXP (src, 1));
< if (GET_CODE (src) == PLUS)
< offset = -offset;
< cfa_offset += offset;
< }
---
> 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 = HARD_FRAME_POINTER_REGNUM;
> }
> else if (XEXP (src, 0) == hard_frame_pointer_rtx
> && GET_CODE (XEXP (src, 1)) == CONST_INT)
> {
> if (cfa_reg != (unsigned) HARD_FRAME_POINTER_REGNUM)
> abort ();
> offset = INTVAL (XEXP (src, 1));
> if (GET_CODE (src) == PLUS)
> offset = -offset;
> cfa_offset += offset;
> }
1311,1312c1319,1320
< else
< abort();
---
> else
> abort();
1314,1327c1322,1335
< else
< {
< if (GET_CODE (src) != PLUS
< || XEXP (src, 1) != stack_pointer_rtx)
< abort ();
< if (GET_CODE (XEXP (src, 0)) != REG
< || 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;
---
> 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;
1329,1332c1337,1340
< case CONST_INT:
< cfa_temp_reg = REGNO (dest);
< cfa_temp_value = INTVAL (src);
< break;
---
> case CONST_INT:
> cfa_temp_reg = REGNO (dest);
> cfa_temp_value = INTVAL (src);
> break;
1334,1341c1342,1349
< case IOR:
< if (GET_CODE (XEXP (src, 0)) != REG
< || REGNO (XEXP (src, 0)) != cfa_temp_reg
< || REGNO (dest) != cfa_temp_reg
< || GET_CODE (XEXP (src, 1)) != CONST_INT)
< abort ();
< cfa_temp_value |= INTVAL (XEXP (src, 1));
< 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;
1343,1345c1351,1353
< default:
< abort ();
< }
---
> default:
> abort ();
> }
1347c1355
< break;
---
> break;
1349,1361c1357,1369
< 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;
---
> 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;
1363,1368c1371,1376
< 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;
---
> 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;
1370,1371c1378,1379
< offset = -cfa_store_offset;
< break;
---
> offset = -cfa_store_offset;
> break;
1373,1378c1381,1386
< /* With an offset. */
< case PLUS:
< case MINUS:
< offset = INTVAL (XEXP (XEXP (dest, 0), 1));
< if (GET_CODE (src) == MINUS)
< offset = -offset;
---
> /* With an offset. */
> case PLUS:
> case MINUS:
> offset = INTVAL (XEXP (XEXP (dest, 0), 1));
> if (GET_CODE (XEXP (dest, 0)) == MINUS)
> offset = -offset;
1380,1383c1388,1391
< if (cfa_store_reg != REGNO (XEXP (XEXP (dest, 0), 0)))
< abort ();
< offset -= cfa_store_offset;
< break;
---
> if (cfa_store_reg != (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
> abort ();
> offset -= cfa_store_offset;
> break;
1385,1390c1393,1398
< default:
< abort ();
< }
< dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
< dwarf2out_reg_save (label, REGNO (src), offset);
< break;
---
> /* Without an offset. */
> case REG:
> if (cfa_store_reg != (unsigned) REGNO (XEXP (dest, 0)))
> abort();
> offset = -cfa_store_offset;
> break;
1392,1393c1400,1435
< default:
< abort ();
---
> default:
> abort ();
> }
> dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
> dwarf2out_reg_save (label, REGNO (src), offset);
> break;
>
> default:
> abort ();
> }
> }
>
>
> /* 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;
>
> 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;
1394a1437,1452
>
> 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);
>
> dwarf2out_frame_debug_expr (insn, label);
1668c1726
< data_section ();
---
> force_data_section ();
1805a1864,1871
> /* ??? 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. */
1807c1873
< ASM_OUTPUT_DWARF_DELTA (asm_out_file, l1, "__FRAME_BEGIN__");
---
> ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, l1, "__FRAME_BEGIN__");
1985c2051
< dw_val_class_section_offset,
---
> dw_val_class_lbl_offset,
2064d2129
< char *val_section;
2363a2429,2444
> /* A pointer to the base of a list of incomplete types which might be
> completed at some later time. */
>
> static tree *incomplete_types_list;
>
> /* Number of elements currently allocated for the incomplete_types_list. */
> static unsigned incomplete_types_allocated;
>
> /* Number of elements of incomplete_types_list currently in use. */
> static unsigned incomplete_types;
>
> /* Size (in elements) of increments by which we may expand the incomplete
> types list. Actually, a single hunk of space of this size should
> be enough for most typical programs. */
> #define INCOMPLETE_TYPES_INCREMENT 64
>
2423c2504
< static void add_AT_section_offset PROTO((dw_die_ref,
---
> static void add_AT_lbl_offset PROTO((dw_die_ref,
2595a2677,2678
> /* Labels we insert at beginning sections we can reference instead of
> the section names themselves. */
2596a2680,2693
> #ifndef TEXT_SECTION_LABEL
> #define TEXT_SECTION_LABEL "Ltext"
> #endif
> #ifndef DEBUG_LINE_SECTION_LABEL
> #define DEBUG_LINE_SECTION_LABEL "Ldebug_line"
> #endif
> #ifndef DEBUG_INFO_SECTION_LABEL
> #define DEBUG_INFO_SECTION_LABEL "Ldebug_info"
> #endif
> #ifndef ABBREV_SECTION_LABEL
> #define ABBREV_SECTION_LABEL "Ldebug_abbrev"
> #endif
>
>
2603a2701,2704
> static char text_section_label[MAX_ARTIFICIAL_LABEL_BYTES];
> static char abbrev_section_label[MAX_ARTIFICIAL_LABEL_BYTES];
> static char debug_info_section_label[MAX_ARTIFICIAL_LABEL_BYTES];
> static char debug_line_section_label[MAX_ARTIFICIAL_LABEL_BYTES];
2640,2646c2741,2752
< #define ASM_NAME_TO_STRING(STR, NAME) \
< do { \
< if ((NAME)[0] == '*') \
< dyn_string_append (STR, NAME + 1); \
< else \
< dyn_string_append (STR, NAME); \
< } \
---
> #define ASM_NAME_TO_STRING(STR, NAME) \
> do { \
> if ((NAME)[0] == '*') \
> dyn_string_append (STR, NAME + 1); \
> else \
> { \
> char *newstr; \
> STRIP_NAME_ENCODING (newstr, NAME); \
> dyn_string_append (STR, user_label_prefix); \
> dyn_string_append (STR, newstr); \
> } \
> } \
3520c3626,3631
< register tree immediate_origin = DECL_ABSTRACT_ORIGIN (decl);
---
> #ifdef ENABLE_CHECKING
> if (DECL_FROM_INLINE (DECL_ORIGIN (decl)))
> /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the
> most distant ancestor, this should never happen. */
> abort ();
> #endif
3522,3537c3633
< if (immediate_origin == NULL_TREE)
< return NULL_TREE;
< else
< {
< register tree ret_val;
< register tree lookahead = immediate_origin;
<
< do
< {
< ret_val = lookahead;
< lookahead = DECL_ABSTRACT_ORIGIN (ret_val);
< }
< while (lookahead != NULL && lookahead != ret_val);
<
< return ret_val;
< }
---
> return DECL_ABSTRACT_ORIGIN (decl);
3810c3906
< add_AT_section_offset (die, attr_kind, section)
---
> add_AT_lbl_offset (die, attr_kind, label)
3813c3909
< register char *section;
---
> register char *label;
3819,3820c3915,3916
< attr->dw_attr_val.val_class = dw_val_class_section_offset;
< attr->dw_attr_val.v.val_section = section;
---
> attr->dw_attr_val.val_class = dw_val_class_lbl_offset;
> attr->dw_attr_val.v.val_lbl_id = label;
4282a4379
> case dw_val_class_lbl_offset:
4285,4287d4381
< case dw_val_class_section_offset:
< fprintf (outfile, "section: %s", a->dw_attr_val.v.val_section);
< break;
4651c4745
< case dw_val_class_section_offset:
---
> case dw_val_class_lbl_offset:
4753,4755d4846
< /* Set address register instruction. */
< size += size_of_set_address;
<
4760c4851
< register dw_line_info_ref line_info;
---
> register dw_line_info_ref line_info = &line_info_table[lt_index];
4761a4853,4856
> if (line_info->dw_line_num == current_line
> && line_info->dw_file_num == current_file)
> continue;
>
4769d4863
< line_info = &line_info_table[lt_index];
4812a4907,4912
>
> if (line_info->dw_line_num == current_line
> && line_info->dw_file_num == current_file
> && line_info->function == function)
> goto cont;
>
4854a4955
> cont:
4964c5065
< case dw_val_class_section_offset:
---
> case dw_val_class_lbl_offset:
5036a5138,5142
>
> /* We need to properly terminate the abbrev table for this
> compilation unit, as per the standard, and not rely on
> workarounds in e.g. gdb. */
> fprintf (asm_out_file, "\t%s\t0\n", ASM_BYTE_OP);
5186d5291
< register int i;
5289,5293c5394,5400
< ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
< a->dw_attr_val.v.val_float.length * 4);
< if (flag_debug_asm)
< fprintf (asm_out_file, "\t%s %s",
< ASM_COMMENT_START, dwarf_attr_name (a->dw_attr));
---
> {
> register unsigned int i;
> ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
> a->dw_attr_val.v.val_float.length * 4);
> if (flag_debug_asm)
> fprintf (asm_out_file, "\t%s %s",
> ASM_COMMENT_START, dwarf_attr_name (a->dw_attr));
5295,5302c5402,5409
< fputc ('\n', asm_out_file);
< for (i = 0; i < a->dw_attr_val.v.val_float.length; ++i)
< {
< ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
< a->dw_attr_val.v.val_float.array[i]);
< if (flag_debug_asm)
< fprintf (asm_out_file, "\t%s fp constant word %d",
< ASM_COMMENT_START, i);
---
> fputc ('\n', asm_out_file);
> for (i = 0; i < a->dw_attr_val.v.val_float.length; ++i)
> {
> ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
> a->dw_attr_val.v.val_float.array[i]);
> if (flag_debug_asm)
> fprintf (asm_out_file, "\t%s fp constant word %u",
> ASM_COMMENT_START, i);
5304,5305c5411,5412
< fputc ('\n', asm_out_file);
< }
---
> fputc ('\n', asm_out_file);
> }
5306a5414
> }
5337,5340c5445,5446
< case dw_val_class_section_offset:
< ASM_OUTPUT_DWARF_OFFSET (asm_out_file,
< stripattributes
< (a->dw_attr_val.v.val_section));
---
> case dw_val_class_lbl_offset:
> ASM_OUTPUT_DWARF_OFFSET (asm_out_file, a->dw_attr_val.v.val_lbl_id);
5349c5455
< strlen (a->dw_attr_val.v.val_str) + 1);
---
> (int) strlen (a->dw_attr_val.v.val_str) + 1);
5400c5506
< ASM_OUTPUT_DWARF_OFFSET (asm_out_file, stripattributes (ABBREV_SECTION));
---
> ASM_OUTPUT_DWARF_OFFSET (asm_out_file, abbrev_section_label);
5473c5579
< ASM_OUTPUT_DWARF_OFFSET (asm_out_file, stripattributes (DEBUG_INFO_SECTION));
---
> ASM_OUTPUT_DWARF_OFFSET (asm_out_file, debug_info_section_label);
5501c5607,5608
< ASM_OUTPUT_ASCII (asm_out_file, pub->name, strlen (pub->name) + 1);
---
> ASM_OUTPUT_ASCII (asm_out_file, pub->name,
> (int) strlen (pub->name) + 1);
5553c5660
< ASM_OUTPUT_DWARF_OFFSET (asm_out_file, stripattributes (DEBUG_INFO_SECTION));
---
> ASM_OUTPUT_DWARF_OFFSET (asm_out_file, debug_info_section_label);
5579c5686
< ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_SECTION);
---
> ASM_OUTPUT_DWARF_ADDR (asm_out_file, text_section_label);
5584c5691,5692
< ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file, text_end_label, TEXT_SECTION);
---
> ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file, text_end_label,
> text_section_label);
5737c5845
< strlen (file_table[ft_index]) + 1);
---
> (int) strlen (file_table[ft_index]) + 1);
5759,5762c5867,5869
< /* Set the address register to the first location in the text section */
< ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
< if (flag_debug_asm)
< fprintf (asm_out_file, "\t%s DW_LNE_set_address", ASM_COMMENT_START);
---
> /* We used to set the address register to the first location in the text
> section here, but that didn't accomplish anything since we already
> have a line note for the opening brace of the first function. */
5764,5771d5870
< fputc ('\n', asm_out_file);
< output_uleb128 (1 + PTR_SIZE);
< fputc ('\n', asm_out_file);
< ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_set_address);
< fputc ('\n', asm_out_file);
< ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_SECTION);
< fputc ('\n', asm_out_file);
<
5776c5875
< strcpy (prev_line_label, TEXT_SECTION);
---
> strcpy (prev_line_label, text_section_label);
5779c5878
< register dw_line_info_ref line_info;
---
> register dw_line_info_ref line_info = &line_info_table[lt_index];
5780a5880,5886
> /* Don't emit anything for redundant notes. Just updating the
> address doesn't accomplish anything, because we already assume
> that anything after the last address is this line. */
> if (line_info->dw_line_num == current_line
> && line_info->dw_file_num == current_file)
> continue;
>
5823d5928
< line_info = &line_info_table[lt_index];
5841,5844c5946
< line_offset = line_info->dw_line_num - current_line;
< line_delta = line_offset - DWARF_LINE_BASE;
< current_line = line_info->dw_line_num;
< if (line_delta >= 0 && line_delta < (DWARF_LINE_RANGE - 1))
---
> if (line_info->dw_line_num != current_line)
5846,5853c5948,5960
< /* This can handle deltas from -10 to 234, using the current
< definitions of DWARF_LINE_BASE and DWARF_LINE_RANGE. This
< takes 1 byte. */
< ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
< DWARF_LINE_OPCODE_BASE + line_delta);
< if (flag_debug_asm)
< fprintf (asm_out_file,
< "\t%s line %ld", ASM_COMMENT_START, current_line);
---
> line_offset = line_info->dw_line_num - current_line;
> line_delta = line_offset - DWARF_LINE_BASE;
> current_line = line_info->dw_line_num;
> if (line_delta >= 0 && line_delta < (DWARF_LINE_RANGE - 1))
> {
> /* This can handle deltas from -10 to 234, using the current
> definitions of DWARF_LINE_BASE and DWARF_LINE_RANGE. This
> takes 1 byte. */
> ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
> DWARF_LINE_OPCODE_BASE + line_delta);
> if (flag_debug_asm)
> fprintf (asm_out_file,
> "\t%s line %ld", ASM_COMMENT_START, current_line);
5855c5962,5980
< fputc ('\n', asm_out_file);
---
> fputc ('\n', asm_out_file);
> }
> else
> {
> /* This can handle any delta. This takes at least 4 bytes,
> depending on the value being encoded. */
> ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_advance_line);
> if (flag_debug_asm)
> fprintf (asm_out_file, "\t%s advance to line %ld",
> ASM_COMMENT_START, current_line);
>
> fputc ('\n', asm_out_file);
> output_sleb128 (line_offset);
> fputc ('\n', asm_out_file);
> ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
> if (flag_debug_asm)
> fprintf (asm_out_file, "\t%s DW_LNS_copy", ASM_COMMENT_START);
> fputc ('\n', asm_out_file);
> }
5859,5861c5984,5985
< /* This can handle any delta. This takes at least 4 bytes, depending
< on the value being encoded. */
< ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_advance_line);
---
> /* We still need to start a new row, so output a copy insn. */
> ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
5863,5865c5987
< fprintf (asm_out_file, "\t%s advance to line %ld",
< ASM_COMMENT_START, current_line);
<
---
> fprintf (asm_out_file, "\t%s DW_LNS_copy", ASM_COMMENT_START);
5867,5870d5988
< output_sleb128 (line_offset);
< fputc ('\n', asm_out_file);
< ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
< fputc ('\n', asm_out_file);
5918a6037,6042
> /* Don't emit anything for redundant notes. */
> if (line_info->dw_line_num == current_line
> && line_info->dw_file_num == current_file
> && line_info->function == function)
> goto cont;
>
6018a6143,6144
> if (flag_debug_asm)
> fprintf (asm_out_file, "\t%s DW_LNS_copy", ASM_COMMENT_START);
6021a6148,6155
> else
> {
> /* We still need to start a new row, so output a copy insn. */
> ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
> if (flag_debug_asm)
> fprintf (asm_out_file, "\t%s DW_LNS_copy", ASM_COMMENT_START);
> fputc ('\n', asm_out_file);
> }
6022a6157
> cont:
7056c7191,7192
< && TYPE_SIZE (declared_type) <= TYPE_SIZE (passed_type))
---
> && (GET_MODE_SIZE (TYPE_MODE (declared_type))
> <= GET_MODE_SIZE (TYPE_MODE (passed_type))))
7058a7195,7226
>
> /* If the parm was passed in registers, but lives on the stack, then
> make a big endian correction if the mode of the type of the
> parameter is not the same as the mode of the rtl. */
> /* ??? This is the same series of checks that are made in dbxout.c before
> we reach the big endian correction code there. It isn't clear if all
> of these checks are necessary here, but keeping them all is the safe
> thing to do. */
> else if (GET_CODE (rtl) == MEM
> && XEXP (rtl, 0) != const0_rtx
> && ! CONSTANT_P (XEXP (rtl, 0))
> /* Not passed in memory. */
> && GET_CODE (DECL_INCOMING_RTL (decl)) != MEM
> /* Not passed by invisible reference. */
> && (GET_CODE (XEXP (rtl, 0)) != REG
> || REGNO (XEXP (rtl, 0)) == HARD_FRAME_POINTER_REGNUM
> || REGNO (XEXP (rtl, 0)) == STACK_POINTER_REGNUM
> #if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
> || REGNO (XEXP (rtl, 0)) == ARG_POINTER_REGNUM
> #endif
> )
> /* Big endian correction check. */
> && BYTES_BIG_ENDIAN
> && TYPE_MODE (TREE_TYPE (decl)) != GET_MODE (rtl)
> && (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (decl)))
> < UNITS_PER_WORD))
> {
> int offset = (UNITS_PER_WORD
> - GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (decl))));
> rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (decl)),
> plus_constant (XEXP (rtl, 0), offset));
> }
7066c7234
< if (leaf_function)
---
> if (current_function_uses_only_leaf_regs)
7531c7699
< if (TREE_CODE_CLASS (TREE_CODE (scope)) == 't')
---
> if (AGGREGATE_TYPE_P (scope))
7582a7751,7756
> /* Ignore function type "scopes" from the C frontend. They mean that
> a tagged type is local to a parmlist of a function declarator, but
> that isn't useful to DWARF. */
> if (containing_scope && TREE_CODE (containing_scope) == FUNCTION_TYPE)
> containing_scope = NULL_TREE;
>
7619,7620c7793
< if (scope_die != comp_unit_die
< || TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 't')
---
> if (TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 't')
7624a7798,7800
>
> /* If none of the current dies are suitable, we get file scope. */
> scope_die = comp_unit_die;
7883a8060,8092
> /* Remember a type in the incomplete_types_list. */
>
> static void
> add_incomplete_type (type)
> tree type;
> {
> if (incomplete_types == incomplete_types_allocated)
> {
> incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
> incomplete_types_list
> = (tree *) xrealloc (incomplete_types_list,
> sizeof (tree) * incomplete_types_allocated);
> }
>
> incomplete_types_list[incomplete_types++] = type;
> }
>
> /* Walk through the list of incomplete types again, trying once more to
> emit full debugging info for them. */
>
> static void
> retry_incomplete_types ()
> {
> register tree type;
>
> while (incomplete_types)
> {
> --incomplete_types;
> type = incomplete_types_list[incomplete_types];
> gen_type_die (type, comp_unit_die);
> }
> }
>
8165c8374,8384
< abort ();
---
> {
> /* ??? This can happen if there is a bug in the program, for
> instance, if it has duplicate function definitions. Ideally,
> we should detect this case and ignore it. For now, if we have
> already reported an error, any error at all, then assume that
> we got here because of a input error, not a dwarf2 bug. */
> extern int errorcount;
> if (errorcount)
> return;
> abort ();
> }
8493c8712,8718
< if (GET_CODE (insn) == CODE_LABEL)
---
>
> /* Deleted labels are programmer specified labels which have been
> eliminated because of various optimisations. We still emit them
> here so that it is possible to put breakpoints on them. */
> if (GET_CODE (insn) == CODE_LABEL
> || ((GET_CODE (insn) == NOTE
> && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
8800c9025
< && TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't')
---
> && AGGREGATE_TYPE_P (TYPE_CONTEXT (type)))
8859c9084,9090
< add_AT_flag (type_die, DW_AT_declaration, 1);
---
> {
> add_AT_flag (type_die, DW_AT_declaration, 1);
>
> /* We can't do this for function-local types, and we don't need to. */
> if (TREE_PERMANENT (type))
> add_incomplete_type (type);
> }
9013c9244
< && TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't'
---
> && AGGREGATE_TYPE_P (TYPE_CONTEXT (type))
9032c9263
< && TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't'
---
> && AGGREGATE_TYPE_P (TYPE_CONTEXT (type))
9412c9643
< && DECL_INITIAL (decl) != NULL)
---
> && DECL_INITIAL (decl) != NULL)
9777a10009,10023
> ASM_GENERATE_INTERNAL_LABEL (abbrev_section_label, ABBREV_SECTION_LABEL, 0);
> ASM_GENERATE_INTERNAL_LABEL (text_section_label, TEXT_SECTION_LABEL, 0);
> ASM_GENERATE_INTERNAL_LABEL (debug_info_section_label,
> DEBUG_INFO_SECTION_LABEL, 0);
> ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label,
> DEBUG_LINE_SECTION_LABEL, 0);
>
> ASM_OUTPUT_SECTION (asm_out_file, ABBREV_SECTION);
> ASM_OUTPUT_LABEL (asm_out_file, abbrev_section_label);
> ASM_OUTPUT_SECTION (asm_out_file, TEXT_SECTION);
> ASM_OUTPUT_LABEL (asm_out_file, text_section_label);
> ASM_OUTPUT_SECTION (asm_out_file, DEBUG_INFO_SECTION);
> ASM_OUTPUT_LABEL (asm_out_file, debug_info_section_label);
> ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION);
> ASM_OUTPUT_LABEL (asm_out_file, debug_line_section_label);
9812a10059,10062
> /* Walk through the list of incomplete types again, trying once more to
> emit full debugging info for them. */
> retry_incomplete_types ();
>
9845c10095
< add_AT_lbl_id (comp_unit_die, DW_AT_low_pc, TEXT_SECTION);
---
> add_AT_lbl_id (comp_unit_die, DW_AT_low_pc, text_section_label);
9849c10099,10100
< add_AT_section_offset (comp_unit_die, DW_AT_stmt_list, DEBUG_LINE_SECTION);
---
> add_AT_lbl_offset (comp_unit_die, DW_AT_stmt_list,
> debug_line_section_label);