aboutsummaryrefslogtreecommitdiff
path: root/gcc/var-tracking.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2016-01-11 10:40:33 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2016-01-11 10:40:33 +0000
commitb4934671aed067e0a8c3ac3fcc5871dd27a706ed (patch)
treef256be24de028f3ba0f7322f307659ce87652c96 /gcc/var-tracking.c
parent4708731cceffa32a0bcddb8300147369299c4361 (diff)
downloadgcc-b4934671aed067e0a8c3ac3fcc5871dd27a706ed.zip
gcc-b4934671aed067e0a8c3ac3fcc5871dd27a706ed.tar.gz
gcc-b4934671aed067e0a8c3ac3fcc5871dd27a706ed.tar.bz2
[PR69123] fix handling of MEMs in VTA to avoid dataflow oscillation
The problem arises because we used to drop overwritten MEMs from loc lists of VALUEs, but not of other onepart variables, and it just so happens that, by doing so, block 6 in the testcase has no D#5 in its output in the first pass, because the MEM holding its (previous) value was correctly dropped from value 88:88, but gains it in the second pass because D#5 has the MEM location incoming directly in its loc list, rather than indirectly in a VALUE. This incorrect binding enables other blocks to believe they have a tentative binding for D#5 in some cycles, but others, still operating on the early conclusion, believe there isn't, and they oscillate from that. Since we check for escaping MEMs in clobbers, we won't lose anything relevant by dropping call-clobbered or overwritten MEMs in all onepart variables, and this ensures the loc intersection operation in onepart vars won't let a MEM through that wasn't present in earlier iterations. for gcc/ChangeLog PR bootstrap/69123 * var-tracking.c (drop_overlapping_mem_locs): Operate on all onepart vars. Fix typo in comment. Fix reversed condition in unshare test. (dataflow_set_remove_mem_locs): Operate on all onepart vars. for gcc/testsuite/ChangeLog PR bootstrap/69123 * g++.dg/pr69123.C: New. From-SVN: r232218
Diffstat (limited to 'gcc/var-tracking.c')
-rw-r--r--gcc/var-tracking.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 023a73e..86183b3 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -2224,7 +2224,7 @@ struct overlapping_mems
};
/* Remove all MEMs that overlap with COMS->LOC from the location list
- of a hash table entry for a value. COMS->ADDR must be a
+ of a hash table entry for a onepart variable. COMS->ADDR must be a
canonicalized form of COMS->LOC's address, and COMS->LOC must be
canonicalized itself. */
@@ -2235,7 +2235,7 @@ drop_overlapping_mem_locs (variable **slot, overlapping_mems *coms)
rtx mloc = coms->loc, addr = coms->addr;
variable *var = *slot;
- if (var->onepart == ONEPART_VALUE)
+ if (var->onepart != NOT_ONEPART)
{
location_chain *loc, **locp;
bool changed = false;
@@ -4682,11 +4682,11 @@ dataflow_set_preserve_mem_locs (variable **slot, dataflow_set *set)
{
for (loc = var->var_part[0].loc_chain; loc; loc = loc->next)
{
- /* We want to remove dying MEMs that doesn't refer to DECL. */
+ /* We want to remove dying MEMs that don't refer to DECL. */
if (GET_CODE (loc->loc) == MEM
&& (MEM_EXPR (loc->loc) != decl
|| INT_MEM_OFFSET (loc->loc) != 0)
- && !mem_dies_at_call (loc->loc))
+ && mem_dies_at_call (loc->loc))
break;
/* We want to move here MEMs that do refer to DECL. */
else if (GET_CODE (loc->loc) == VALUE
@@ -4769,14 +4769,14 @@ dataflow_set_preserve_mem_locs (variable **slot, dataflow_set *set)
}
/* Remove all MEMs from the location list of a hash table entry for a
- value. */
+ onepart variable. */
int
dataflow_set_remove_mem_locs (variable **slot, dataflow_set *set)
{
variable *var = *slot;
- if (var->onepart == ONEPART_VALUE)
+ if (var->onepart != NOT_ONEPART)
{
location_chain *loc, **locp;
bool changed = false;