aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-05-05 11:25:01 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2010-05-05 11:25:01 +0200
commitdbb2a2cba89ecf16263f4e3e316b9f4f61637565 (patch)
tree4557c5bcc52cc76180e0860ccd7d40985747c3f7 /gcc
parent371b334e65a898cd795259aebfd60b27d3b963b9 (diff)
downloadgcc-dbb2a2cba89ecf16263f4e3e316b9f4f61637565.zip
gcc-dbb2a2cba89ecf16263f4e3e316b9f4f61637565.tar.gz
gcc-dbb2a2cba89ecf16263f4e3e316b9f4f61637565.tar.bz2
var-tracking.c (var_debug_decl): Save DECL_DEBUG_EXPR value in a temporary instead of invoking the macro...
* var-tracking.c (var_debug_decl): Save DECL_DEBUG_EXPR value in a temporary instead of invoking the macro multiple times. (track_expr_p): Likewise. From-SVN: r159058
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/var-tracking.c15
2 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5eed15d..6d232bb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-05 Jakub Jelinek <jakub@redhat.com>
+
+ * var-tracking.c (var_debug_decl): Save DECL_DEBUG_EXPR value
+ in a temporary instead of invoking the macro multiple times.
+ (track_expr_p): Likewise.
+
2010-05-04 Neil Vachharajani <nvachhar@google.com>
* doc/invoke.texi (-Wcoverage-mismatch): Updated documentation as
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 55de209..040a3e7a5 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -1573,9 +1573,12 @@ static inline tree
var_debug_decl (tree decl)
{
if (decl && DECL_P (decl)
- && DECL_DEBUG_EXPR_IS_FROM (decl) && DECL_DEBUG_EXPR (decl)
- && DECL_P (DECL_DEBUG_EXPR (decl)))
- decl = DECL_DEBUG_EXPR (decl);
+ && DECL_DEBUG_EXPR_IS_FROM (decl))
+ {
+ tree debugdecl = DECL_DEBUG_EXPR (decl);
+ if (debugdecl && DECL_P (debugdecl))
+ decl = debugdecl;
+ }
return decl;
}
@@ -4497,12 +4500,14 @@ track_expr_p (tree expr, bool need_rtl)
don't need to track this expression if the ultimate declaration is
ignored. */
realdecl = expr;
- if (DECL_DEBUG_EXPR_IS_FROM (realdecl) && DECL_DEBUG_EXPR (realdecl))
+ if (DECL_DEBUG_EXPR_IS_FROM (realdecl))
{
realdecl = DECL_DEBUG_EXPR (realdecl);
+ if (realdecl == NULL_TREE)
+ realdecl = expr;
/* ??? We don't yet know how to emit DW_OP_piece for variable
that has been SRA'ed. */
- if (!DECL_P (realdecl))
+ else if (!DECL_P (realdecl))
return 0;
}