diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-24 05:23:10 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-12-24 05:23:10 +0000 |
commit | bbc7bce1c47bab845c0b7e35395958f7ec852660 (patch) | |
tree | a627db8a80c09e929338b90c21134a1193390049 /gcc/var-tracking.c | |
parent | e92a2a2e96093e5721ddcba7c1ec3425c5b68d26 (diff) | |
download | gcc-bbc7bce1c47bab845c0b7e35395958f7ec852660.tar.gz |
2004-12-24 Daniel Berlin <dberlin@dberlin.org>
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92585 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/var-tracking.c')
-rw-r--r-- | gcc/var-tracking.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 72cb81d927e..ef9f9dcc5d6 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -244,7 +244,7 @@ typedef struct variable_def } *variable; /* Hash function for DECL for VARIABLE_HTAB. */ -#define VARIABLE_HASH_VAL(decl) ((size_t) (decl)) +#define VARIABLE_HASH_VAL(decl) (DECL_UID (decl)) /* Pointer to the BB's information specific to variable tracking pass. */ #define VTI(BB) ((variable_tracking_info) (BB)->aux) @@ -1441,6 +1441,7 @@ static bool track_expr_p (tree expr) { rtx decl_rtl; + tree realdecl; /* If EXPR is not a parameter or a variable do not track it. */ if (TREE_CODE (expr) != VAR_DECL && TREE_CODE (expr) != PARM_DECL) @@ -1454,14 +1455,22 @@ track_expr_p (tree expr) decl_rtl = DECL_RTL_IF_SET (expr); if (!decl_rtl) return 0; - - /* Do not track EXPR if it should be ignored for debugging purposes. */ - if (DECL_IGNORED_P (expr)) + + /* If this expression is really a debug alias of some other declaration, we + don't need to track this expression if the ultimate declaration is + ignored. */ + realdecl = expr; + if (DECL_DEBUG_ALIAS_OF (realdecl)) + realdecl = DECL_DEBUG_ALIAS_OF (realdecl); + + /* Do not track EXPR if REALDECL it should be ignored for debugging + purposes. */ + if (DECL_IGNORED_P (realdecl)) return 0; /* Do not track global variables until we are able to emit correct location list for them. */ - if (TREE_STATIC (expr)) + if (TREE_STATIC (realdecl)) return 0; /* When the EXPR is a DECL for alias of some variable (see example) |