https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109849
--- Comment #47 from Richard Biener <rguenth at gcc dot gnu.org> ---
__BB(2,guessed_local(114863530)):
_7 = __MEM <const struct pair * const> ((const struct pair * const &)&stack);
goto __BB4(precise(134217728));
__BB(4,loop_header(1),guessed_local(1073741824)):
_6 = __MEM <const struct pair * const> ((const struct pair * const &)&stack +
_Literal (const struct pair * const &) 8);
if (_6 != _7)
goto __BB3(guessed(126835753));
else
goto __BB5(guessed(7381975));
__BB(3,guessed_local(1014686025)):
cur$second_8 = __MEM <const struct pair> ((const struct pair &)_6 + _Literal
(const struct pair &) 18446744073709551608).second;
_5 = _6 + 18446744073709551608ul;
stack.D_25459._M_impl.D_24774._M_finish = _5;
__MEM <struct pair> ((struct pair *)_6 + _Literal (struct pair *)
18446744073709551608) ={v} _Literal (struct pair) {CLOBBER(eob)};
if (cur$second_8 != 0u)
goto __BB5(guessed(7381975));
else
goto __BB6(guessed(126835753));
__BB(6,guessed_local(958878294)):
goto __BB4(precise(134217728));
__BB(5,guessed_local(114863531)):
return;
so the opportunity would be the
__MEM <const struct pair * const> ((const struct pair * const &)&stack +
_Literal (const struct pair * const &) 8)
load plus the
stack.D_25459._M_impl.D_24774._M_finish = _5;
store. We do not consider this pair for store-motion, but we cannot handle
the case of a conditional store with "alternate" refs (the clobber) that
have to be moved together and we cannot disambiguate the store against
the clobber, mainly because of
static bool
sm_seq_push_down (vec<seq_entry> &seq, unsigned ptr, unsigned *at)
{
...
/* We may not ignore self-dependences here. */
if (new_cand.first == against.first
/* ??? We could actually handle clobbers here, but not easily
with LIMs dependence analysis. */
|| (memory_accesses.refs_list[new_cand.first]->mem.ref
== error_mark_node)
|| (memory_accesses.refs_list[against.first]->mem.ref
== error_mark_node)
but we can probably special-case the clobbers where we fail for them,
as we can actually re-materialize it. I have a patch for that,
but I wonder about what I meant with "location" in the following ...
/* We cannot handle sm_other since we neither remember the
stored location nor the value at the point we execute them. */
for (unsigned i = 0; i < seq.length (); ++i)
{