summaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-26 13:29:14 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-26 13:29:14 +0000
commit69f01c7b82d1ad45b5aebcb1d8b9125fe8d88411 (patch)
treed79fd31113105885baed67230b6f97b7bb452a81 /gcc/gimple-fold.c
parent05eda0e76f321e8b27e8c31981837eeaa3cd0995 (diff)
downloadgcc-69f01c7b82d1ad45b5aebcb1d8b9125fe8d88411.tar.gz
2010-07-26 Richard Guenther <rguenther@suse.de>
PR middle-end/45056 * gimple-fold.c (fold_stmt_1): Also fold references in debug stmts. * g++.dg/pr45056.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162536 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 5bf82822a90..5953d6a7593 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -1530,6 +1530,23 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace)
}
break;
+ case GIMPLE_DEBUG:
+ if (gimple_debug_bind_p (stmt))
+ {
+ tree val = gimple_debug_bind_get_value (stmt);
+ if (val
+ && REFERENCE_CLASS_P (val))
+ {
+ tree tem = maybe_fold_reference (val, false);
+ if (tem)
+ {
+ gimple_debug_bind_set_value (stmt, tem);
+ changed = true;
+ }
+ }
+ }
+ break;
+
default:;
}