diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2000-01-25 00:59:18 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-01-25 00:59:18 -0500 |
commit | 1865dbb5e2cac2bdcbfdc136b57ef079a1b3adff (patch) | |
tree | 9b8e288adb2c3828f86368240aa8fa0eb91ec933 /gcc/config | |
parent | 7610f2ce1bff1c54feeb451f0b40dcc3d3350389 (diff) | |
download | gcc-1865dbb5e2cac2bdcbfdc136b57ef079a1b3adff.zip gcc-1865dbb5e2cac2bdcbfdc136b57ef079a1b3adff.tar.gz gcc-1865dbb5e2cac2bdcbfdc136b57ef079a1b3adff.tar.bz2 |
dwarf2out.c: include "varray.h", not dyn-string.h.
* dwarf2out.c: include "varray.h", not dyn-string.h.
(ASM_OUTPUT_DWARF2_ADDR_CONST, ASM_NAME_TO_STRING): Lose.
(addr_const_to_string, addr_to_string): Lose.
(ASM_OUTPUT_DWARF_ADDR_CONST): Copy from dwarfout.c.
(struct dw_val_struct): val_addr is now an rtx.
(add_AT_addr, AT_addr, free_AT, output_aranges): Adjust.
(used_rtx_varray): New varray.
(dwarf2out_init): Initialize it.
(save_rtx): New fn.
(mem_loc_descriptor, add_const_value_attribute): Call it instead of
addr_to_string.
* arm/telf.h, arm/unknown-elf.h, mn10200.h, mn10300.h,
sparc/sp64-elf.h: Remove definition of ASM_OUTPUT_DWARF2_ADDR_CONST.
* Makefile.in (dwarf2out.o): Update dependencies.
* i386.c (i386_dwarf_output_addr_const): New.
* i386.h (ASM_OUTPUT_DWARF_ADDR_CONST): New.
* dwarf2out.c (mem_loc_descriptor): Call ASM_SIMPLIFY_DWARF_ADDR
if defined.
* dwarfout.c (output_mem_loc_descriptor): Likewise.
* i386.c (i386_simplify_dwarf_addr): New.
* i386.h (ASM_SIMPLIFY_DWARF_ADDR): New.
From-SVN: r31602
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/arm/telf.h | 9 | ||||
-rw-r--r-- | gcc/config/arm/unknown-elf.h | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386-protos.h | 3 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 45 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 11 | ||||
-rw-r--r-- | gcc/config/mn10200/mn10200.h | 4 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.h | 4 | ||||
-rw-r--r-- | gcc/config/sparc/sp64-elf.h | 5 |
8 files changed, 62 insertions, 24 deletions
diff --git a/gcc/config/arm/telf.h b/gcc/config/arm/telf.h index ececd53..65a74b3 100644 --- a/gcc/config/arm/telf.h +++ b/gcc/config/arm/telf.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for Thumb with ELF obj format. - Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1999, 2000 Free Software Foundation, Inc. This file is part of GNU CC. @@ -141,13 +141,6 @@ extern int arm_structure_size_boundary; dwarf2.out. */ #define UNALIGNED_WORD_ASM_OP ".4byte" -#define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE,ADDR) \ - if (((ADDR)[0] == '.') && ((ADDR)[1] == 'L')) \ - fprintf ((FILE), "\t%s\t%s", UNALIGNED_WORD_ASM_OP, (ADDR)); \ - else \ - fprintf ((FILE), "\t%s\t%s", \ - UNALIGNED_WORD_ASM_OP, (ADDR)) - #define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) \ do \ { \ diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h index 33bd9af..331c765 100644 --- a/gcc/config/arm/unknown-elf.h +++ b/gcc/config/arm/unknown-elf.h @@ -1,5 +1,5 @@ /* Definitions for non-Linux based ARM systems using ELF - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Catherine Moore <clm@cygnus.com> This file is part of GNU CC. @@ -107,9 +107,6 @@ func_ptr __DTOR_END__[1] = { (func_ptr) 0 }; dwarf2.out. */ #define UNALIGNED_WORD_ASM_OP ".4byte" -#define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE,ADDR) \ - fprintf ((FILE), "\t%s\t%s", UNALIGNED_WORD_ASM_OP, ADDR) - #define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) \ do { \ fprintf ((FILE), "\t%s\t", UNALIGNED_WORD_ASM_OP); \ diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index d589e4f..9d40768 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -82,6 +82,9 @@ extern const char *output_387_binary_op PARAMS ((rtx, rtx*)); extern const char *output_fix_trunc PARAMS ((rtx, rtx*)); extern const char *output_fp_compare PARAMS ((rtx, rtx*, int, int)); +extern void i386_dwarf_output_addr_const PARAMS ((FILE*, rtx)); +extern rtx i386_simplify_dwarf_addr PARAMS ((rtx)); + extern void ix86_expand_move PARAMS ((enum machine_mode, rtx[])); extern void ix86_expand_binary_operator PARAMS ((enum rtx_code, enum machine_mode, rtx[])); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2ea0fb7..a5f2524 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2818,6 +2818,51 @@ output_pic_addr_const (file, x, code) output_operand_lossage ("invalid expression as operand"); } } + +/* This is called from dwarfout.c via ASM_OUTPUT_DWARF_ADDR_CONST. + We need to handle our special PIC relocations. */ + +void +i386_dwarf_output_addr_const (file, x) + FILE *file; + rtx x; +{ + fprintf (file, "\t%s\t", INT_ASM_OP); + if (flag_pic) + output_pic_addr_const (file, x, '\0'); + else + output_addr_const (file, x); + fputc ('\n', file); +} + +/* In the name of slightly smaller debug output, and to cater to + general assembler losage, recognize PIC+GOTOFF and turn it back + into a direct symbol reference. */ + +rtx +i386_simplify_dwarf_addr (orig_x) + rtx orig_x; +{ + rtx x = orig_x; + + if (GET_CODE (x) != PLUS + || GET_CODE (XEXP (x, 0)) != REG + || GET_CODE (XEXP (x, 1)) != CONST) + return orig_x; + + x = XEXP (XEXP (x, 1), 0); + if (GET_CODE (x) == UNSPEC + && XINT (x, 1) == 7) + return XVECEXP (x, 0, 0); + + if (GET_CODE (x) == PLUS + && GET_CODE (XEXP (x, 0)) == UNSPEC + && GET_CODE (XEXP (x, 1)) == CONST_INT + && XINT (XEXP (x, 0), 1) == 7) + return gen_rtx_PLUS (VOIDmode, XVECEXP (XEXP (x, 0), 0, 0), XEXP (x, 1)); + + return orig_x; +} static void put_condition_code (code, mode, reverse, fp, file) diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 0dddfaf..c6af71f 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2309,6 +2309,17 @@ do { long l; \ #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ fprintf (FILE, "\t%s\t%s%d-%s%d\n",ASM_LONG, LPREFIX, VALUE, LPREFIX, REL) +/* A C statement that outputs an address constant appropriate to + for DWARF debugging. */ + +#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,X) \ + i386_dwarf_output_addr_const((FILE),(X)) + +/* Either simplify a location expression, or return the original. */ + +#define ASM_SIMPLIFY_DWARF_ADDR(X) \ + i386_simplify_dwarf_addr(X) + /* Define the parentheses used to group arithmetic operations in assembler code. */ diff --git a/gcc/config/mn10200/mn10200.h b/gcc/config/mn10200/mn10200.h index a976754..60928c4 100644 --- a/gcc/config/mn10200/mn10200.h +++ b/gcc/config/mn10200/mn10200.h @@ -981,10 +981,6 @@ do { char dstr[30]; \ ((GET_CODE (X) == PLUS ? OFFSET : 0) \ + (frame_pointer_needed ? 0 : -total_frame_size ())) -/* We need to prepend underscores. */ -#define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE,ADDR) \ - fprintf ((FILE), "\t%s\t_%s", UNALIGNED_WORD_ASM_OP, (ADDR)) - /* Define to use software floating point emulator for REAL_ARITHMETIC and decimal <-> binary conversion. */ #define REAL_ARITHMETIC diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index d79d4e7..403091e 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -1028,10 +1028,6 @@ do { char dstr[30]; \ + (frame_pointer_needed \ ? 0 : -initial_offset (ARG_POINTER_REGNUM, STACK_POINTER_REGNUM))) -/* We need to prepend underscores. */ -#define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE,ADDR) \ - fprintf ((FILE), "\t%s\t_%s", UNALIGNED_WORD_ASM_OP, (ADDR)) - /* Define to use software floating point emulator for REAL_ARITHMETIC and decimal <-> binary conversion. */ #define REAL_ARITHMETIC diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h index 4fd81c5..4ce12ed 100644 --- a/gcc/config/sparc/sp64-elf.h +++ b/gcc/config/sparc/sp64-elf.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for SPARC64, ELF. - Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1994, 95, 96, 97, 98, 2000 Free Software Foundation, Inc. Contributed by Doug Evans, dje@cygnus.com. This file is part of GNU CC. @@ -146,9 +146,6 @@ do { \ fputc ('\n', (FILE)); \ } while (0) -#define ASM_OUTPUT_DWARF2_ADDR_CONST(FILE, ADDR) \ - fprintf ((FILE), "\t%s\t%s", UNALIGNED_LONGLONG_ASM_OP, (ADDR)) - /* ??? Not sure if this should be 4 or 8 bytes. 4 works for now. */ #define ASM_OUTPUT_DWARF_REF(FILE, LABEL) \ do { \ |