summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-08 13:46:18 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-08 13:46:18 +0000
commit4c04afc72c2a2164bec466c2fcbaac0464d64015 (patch)
treed081466022e877b8bfc365d6788ad977e42f955f
parent6d67f89ed343d26d5733e7b759e7285999594942 (diff)
downloadgcc-4c04afc72c2a2164bec466c2fcbaac0464d64015.tar.gz
2013-03-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/56570 * tree-cfg.c (verify_expr_location_1): Verify locations for DECL_DEBUG_EXPR. * tree-sra.c (create_access_replacement): Strip locations from DECL_DEBUG_EXPRs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196546 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/tree-cfg.c9
-rw-r--r--gcc/tree-sra.c2
3 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4002376f8f9..6fb40c94840 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2013-03-08 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/56570
+ * tree-cfg.c (verify_expr_location_1): Verify locations for
+ DECL_DEBUG_EXPR.
+ * tree-sra.c (create_access_replacement): Strip locations
+ from DECL_DEBUG_EXPRs.
+
+2013-03-08 Richard Biener <rguenther@suse.de>
+
* tree-inline.c (expand_call_inline): Do not associate
a BLOCK with the location in BLOCK_SOURCE_LOCATION.
* tree-cfg.c (verify_location): Verify BLOCK_SOURCE_LOCATION.
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 7be44e42e4b..5466e8b43a1 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -4523,6 +4523,15 @@ verify_expr_location_1 (tree *tp, int *walk_subtrees, void *data)
{
struct pointer_set_t *blocks = (struct pointer_set_t *) data;
+ if (TREE_CODE (*tp) == VAR_DECL
+ && DECL_DEBUG_EXPR_IS_FROM (*tp))
+ {
+ tree t = DECL_DEBUG_EXPR (*tp);
+ tree addr = walk_tree (&t, verify_expr_location_1, blocks, NULL);
+ if (addr)
+ return addr;
+ }
+
if (!EXPR_P (*tp))
{
*walk_subtrees = false;
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 67212c204c4..35dcd432712 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1917,7 +1917,7 @@ create_access_replacement (struct access *access)
&& !DECL_ARTIFICIAL (access->base))
{
char *pretty_name = make_fancy_name (access->expr);
- tree debug_expr = unshare_expr (access->expr), d;
+ tree debug_expr = unshare_expr_without_location (access->expr), d;
bool fail = false;
DECL_NAME (repl) = get_identifier (pretty_name);