diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-25 05:59:18 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-25 05:59:18 +0000 |
commit | eacbfaac1ea13cfe167924742d059527d7e86053 (patch) | |
tree | 9b8e288adb2c3828f86368240aa8fa0eb91ec933 /gcc/config/i386 | |
parent | 4026f475d1a9899257f3e0adf23666700be915fe (diff) | |
download | gcc-eacbfaac1ea13cfe167924742d059527d7e86053.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31602 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386')
-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 |
3 files changed, 59 insertions, 0 deletions
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index d589e4f110a..9d407684679 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 2ea0fb7e99e..a5f2524bce6 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 0dddfafe222..c6af71f8180 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. */ |