summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-08 08:45:29 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-08 08:45:29 +0000
commit58fd1738a06544f7f8ff4520b5c76d1895307199 (patch)
treefc0ee6fbbcd767258261ffb472ddeebea39ea772
parent60e194180351ab4ca1331a0700eace3f5e2b98e6 (diff)
downloadgcc-58fd1738a06544f7f8ff4520b5c76d1895307199.tar.gz
2013-03-08 Richard Biener <rguenther@suse.de>
* tree-ssa-ter.c (is_replaceable_p): Do not TER across location or block changes with -Og. Fix for location / block encoding changes and PHI arguments with locations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196539 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-ter.c22
2 files changed, 17 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d417f40bde8..c44b13bf69c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-03-08 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-ter.c (is_replaceable_p): Do not TER across location
+ or block changes with -Og. Fix for location / block encoding
+ changes and PHI arguments with locations.
+
2013-03-07 Steven Bosscher <steven@gcc.gnu.org>
* bitmap.c (struct bitmap_descriptor_d): Use unsigned HOST_WIDEST_INT
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index b091d786288..2a2e143de38 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -399,22 +399,22 @@ is_replaceable_p (gimple stmt, bool ter)
return false;
locus1 = gimple_location (stmt);
- block1 = gimple_block (stmt);
+ block1 = LOCATION_BLOCK (locus1);
+ locus1 = LOCATION_LOCUS (locus1);
if (gimple_code (use_stmt) == GIMPLE_PHI)
- {
- locus2 = 0;
- block2 = NULL_TREE;
- }
+ locus2 = gimple_phi_arg_location (use_stmt, PHI_ARG_INDEX_FROM_USE (use_p));
else
- {
- locus2 = gimple_location (use_stmt);
- block2 = gimple_block (use_stmt);
- }
+ locus2 = gimple_location (use_stmt);
+ block2 = LOCATION_BLOCK (locus2);
+ locus2 = LOCATION_LOCUS (locus2);
- if (!optimize
+ if ((!optimize || optimize_debug)
&& ter
- && ((locus1 && locus1 != locus2) || (block1 && block1 != block2)))
+ && ((locus1 != UNKNOWN_LOCATION
+ && locus1 != locus2)
+ || (block1 != NULL_TREE
+ && block1 != block2)))
return false;
/* Used in this block, but at the TOP of the block, not the end. */