diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-05 23:18:02 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-05 23:18:02 +0000 |
commit | c5aa1e92211d8e1c3768a94c7a1fcf7e72e8cf80 (patch) | |
tree | 017db6c8be411c52ab98093e94dcce3c7ca3f029 /gcc/dwarf2out.c | |
parent | 870d7a364fabca1efd21f7b8a996934ab7f91805 (diff) | |
download | gcc-c5aa1e92211d8e1c3768a94c7a1fcf7e72e8cf80.tar.gz |
* Check in merge from gcc2. See ChangeLog.12 for details.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19553 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index e8ba8e3995b..ab2fab79d48 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -7174,10 +7174,22 @@ add_bound_info (subrange_die, bound_attr, bound) { register dw_die_ref ctx = lookup_decl_die (current_function_decl); register dw_die_ref decl_die = new_die (DW_TAG_variable, ctx); + register rtx loc = SAVE_EXPR_RTL (bound); + + /* If the RTL for the SAVE_EXPR is memory, handle the case where + it references an outer function's frame. */ + + if (GET_CODE (loc) == MEM) + { + rtx new_addr = fix_lexical_addr (XEXP (loc, 0), bound); + + if (XEXP (loc, 0) != new_addr) + loc = gen_rtx (MEM, GET_MODE (loc), new_addr); + } + add_AT_flag (decl_die, DW_AT_artificial, 1); add_type_attribute (decl_die, TREE_TYPE (bound), 1, 0, ctx); - add_AT_location_description (decl_die, DW_AT_location, - SAVE_EXPR_RTL (bound)); + add_AT_location_description (decl_die, DW_AT_location, loc); add_AT_die_ref (subrange_die, bound_attr, decl_die); } |