Commit df30ab70 by Richard Biener

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.
parent 1d2290ca
2020-04-29 Richard Biener <rguenther@suse.de>
* tree-ssa-loop-im.c (ref_always_accessed::operator ()):
Just check whether the stmt stores.
2020-04-28 Alexandre Oliva <oliva@adacore.com> 2020-04-28 Alexandre Oliva <oliva@adacore.com>
PR target/94812 PR target/94812
......
...@@ -2179,20 +2179,21 @@ ref_always_accessed::operator () (mem_ref_loc *loc) ...@@ -2179,20 +2179,21 @@ ref_always_accessed::operator () (mem_ref_loc *loc)
{ {
class loop *must_exec; 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; return false;
/* If we require an always executed store make sure the statement /* If we require an always executed store make sure the statement
stores to the reference. */ is a store. */
if (stored_p) if (stored_p)
{ {
tree lhs = gimple_get_lhs (loc->stmt); tree lhs = gimple_get_lhs (loc->stmt);
if (!lhs if (!lhs
|| lhs != *loc->ref) || !(DECL_P (lhs) || REFERENCE_CLASS_P (lhs)))
return false; return false;
} }
must_exec = get_lim_data (loc->stmt)->always_executed_in; must_exec = lim_data->always_executed_in;
if (!must_exec) if (!must_exec)
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment