aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-im.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-04-28 14:36:54 +0200
committerRichard Biener <rguenther@suse.de>2020-04-29 08:23:37 +0200
commitdf30ab70690d6088f367e74757f0b5dd6a2587e5 (patch)
treec3e50145f5e2ba929017c2d63714e8aec891f12c /gcc/tree-ssa-loop-im.c
parent1d2290caad0dba52b285b47057b7c0e4e8d21feb (diff)
downloadgcc-df30ab70690d6088f367e74757f0b5dd6a2587e5.zip
gcc-df30ab70690d6088f367e74757f0b5dd6a2587e5.tar.gz
gcc-df30ab70690d6088f367e74757f0b5dd6a2587e5.tar.bz2
fix regression with MEM commoning
This fixes a regression when canonicalizing refs for LIM PR84362. This possibly unshares and rewrites the refs in the internal data and thus pointer equality no longer works in ref_always_accessed computation. 2020-04-29 Richard Biener <rguenther@suse.de> * tree-ssa-loop-im.c (ref_always_accessed::operator ()): Just check whether the stmt stores.
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r--gcc/tree-ssa-loop-im.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 273a580..abd5f70 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -2179,20 +2179,21 @@ ref_always_accessed::operator () (mem_ref_loc *loc)
{
class loop *must_exec;
- if (!get_lim_data (loc->stmt))
+ struct lim_aux_data *lim_data = get_lim_data (loc->stmt);
+ if (!lim_data)
return false;
/* If we require an always executed store make sure the statement
- stores to the reference. */
+ is a store. */
if (stored_p)
{
tree lhs = gimple_get_lhs (loc->stmt);
if (!lhs
- || lhs != *loc->ref)
+ || !(DECL_P (lhs) || REFERENCE_CLASS_P (lhs)))
return false;
}
- must_exec = get_lim_data (loc->stmt)->always_executed_in;
+ must_exec = lim_data->always_executed_in;
if (!must_exec)
return false;