From ac3bfd867b1e0a702551bcf0581b481885eb4938 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Fri, 24 Dec 2004 05:23:10 +0000 Subject: re PR tree-optimization/14638 (Variables disappear from debug info at -O1) 2004-12-24 Daniel Berlin Fix PR debug/14638 * tree.h (DECL_DEBUG_ALIAS_OF): New macro. * var-tracking.c (track_expr_p): Don't disqualify tracking of variables that are aliases of variables we want to track, unless the original variable is also ignored for debugging purposes. (VARIABLE_HASH_VAL): Use DECL_UID, so that this is deterministic. * tree-outof-ssa.c (create_temp): Note who we are a debug alias of. * dwarf2out.c (dwarf2out_var_location): Add us to the location of the decl we are an alias of. From-SVN: r92585 --- gcc/dwarf2out.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index beed56b..26174ec 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -13037,6 +13037,7 @@ dwarf2out_var_location (rtx loc_note) rtx prev_insn; static rtx last_insn; static const char *last_label; + tree decl; if (!DECL_P (NOTE_VAR_LOCATION_DECL (loc_note))) return; @@ -13065,8 +13066,10 @@ dwarf2out_var_location (rtx loc_note) last_insn = loc_note; last_label = newloc->label; - - add_var_loc_to_decl (NOTE_VAR_LOCATION_DECL (loc_note), newloc); + decl = NOTE_VAR_LOCATION_DECL (loc_note); + if (DECL_DEBUG_ALIAS_OF (decl)) + decl = DECL_DEBUG_ALIAS_OF (decl); + add_var_loc_to_decl (decl, newloc); } /* We need to reset the locations at the beginning of each -- cgit v1.1