diff options
author | Richard Henderson <rth@redhat.com> | 2003-08-01 14:51:13 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-08-01 14:51:13 -0700 |
commit | 75c209808126e1c2ef4a5c3ce7c25700416d078f (patch) | |
tree | 09777e2a3ebda4ff012aec58bf5140c64a6bbe37 | |
parent | c197e3066130fb10da0c2f58a3a7fff3ab707487 (diff) | |
download | gcc-75c209808126e1c2ef4a5c3ce7c25700416d078f.zip gcc-75c209808126e1c2ef4a5c3ce7c25700416d078f.tar.gz gcc-75c209808126e1c2ef4a5c3ce7c25700416d078f.tar.bz2 |
system.h: Poison ASM_SIMPLIFY_DWARF_ADDR.
* system.h: Poison ASM_SIMPLIFY_DWARF_ADDR.
* varasm.c (lookup_constant_def): New function.
* rtl.h (lookup_constant_def): Declare it.
* dwarf2out.c (loc_descriptor_from_tree): Use it.
Use targetm.delegitimize_address, not ASM_SIMPLIFY_DWARF_ADDR.
From-SVN: r70072
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 22 | ||||
-rw-r--r-- | gcc/rtl.h | 1 | ||||
-rw-r--r-- | gcc/system.h | 3 | ||||
-rw-r--r-- | gcc/varasm.c | 15 |
5 files changed, 39 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e697f2..a6bbe7e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2003-08-01 Richard Henderson <rth@redhat.com> + + * system.h: Poison ASM_SIMPLIFY_DWARF_ADDR. + + * varasm.c (lookup_constant_def): New function. + * rtl.h (lookup_constant_def): Declare it. + * dwarf2out.c (loc_descriptor_from_tree): Use it. + Use targetm.delegitimize_address, not ASM_SIMPLIFY_DWARF_ADDR. + 2003-08-01 Zack Weinberg <zack@codesourcery.com> * c-decl.c (gettags, pushdecl_function_level): Delete. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 91336a1..48f0f92 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -8560,17 +8560,19 @@ loc_descriptor_from_tree (tree loc, int addressp) case CONSTRUCTOR: { - /* Get an RTL for this, which will may have the effect of outputting - it. This may violates the principle of not having -g affect - the generated code, but it's in the data segment and it's hard - to see a case where it won't already have been output. */ - rtx rtl = output_constant_def (loc, 0); - -#ifdef ASM_SIMPLIFY_DWARF_ADDR - rtl = ASM_SIMPLIFY_DWARF_ADDR (rtl); -#endif + /* Get an RTL for this, if something has been emitted. */ + rtx rtl = lookup_constant_def (loc); + enum machine_mode mode; + + if (GET_CODE (rtl) != MEM) + return 0; + mode = GET_MODE (rtl); + rtl = XEXP (rtl, 0); + + rtl = (*targetm.delegitimize_address) (rtl); + indirect_p = 1; - ret = mem_loc_descriptor (XEXP (rtl, 0), GET_MODE (rtl)); + ret = mem_loc_descriptor (rtl, mode); break; } @@ -1911,6 +1911,7 @@ extern rtx gen_lowpart_SUBREG (enum machine_mode, rtx); #define INVALID_REGNUM (~(unsigned int) 0) extern rtx output_constant_def (tree, int); +extern rtx lookup_constant_def (tree); /* Called from integrate.c when a deferred constant is inlined. */ extern void notice_rtl_inlining_of_deferred_constant (void); diff --git a/gcc/system.h b/gcc/system.h index 14662de..a0117c5 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -586,7 +586,8 @@ typedef char _Bool; WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION SELECT_RTX_SECTION \ ENCODE_SECTION_INFO STRIP_NAME_ENCODING ASM_GLOBALIZE_LABEL \ ASM_OUTPUT_MI_THUNK CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS \ - ADDRESS_COST MACHINE_DEPENDENT_REORG ASM_FILE_START ASM_FILE_END + ADDRESS_COST MACHINE_DEPENDENT_REORG ASM_FILE_START ASM_FILE_END \ + ASM_SIMPLIFY_DWARF_ADDR /* Other obsolete target macros, or macros that used to be in target headers and were not used, and may be obsolete or may never have diff --git a/gcc/varasm.c b/gcc/varasm.c index 63ba1bd..512bc33 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2596,6 +2596,21 @@ notice_rtl_inlining_of_deferred_constant (void) { n_deferred_constants++; } + +/* Look up EXP in the table of constant descriptors. Return the rtl + if it has been emitted, else null. */ + +rtx +lookup_constant_def (tree exp) +{ + struct constant_descriptor_tree *desc; + struct constant_descriptor_tree key; + + key.value = exp; + desc = htab_find (const_desc_htab, &key); + + return (desc ? desc->rtl : NULL_RTX); +} /* Used in the hash tables to avoid outputting the same constant twice. Unlike 'struct constant_descriptor_tree', RTX constants |