https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92692

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Wilco from comment #5)
> Well I'm looking at the latest version
> (https://static.docs.arm.com/ddi0487/ea/DDI0487E_a_armv8_arm.pdf) where in
> figure B2-5 it explicitly states that a store that does not match the
> reservation granule on the same CPU must not change the exclusive state.
> 
> However if a store does match the granule it is implementation defined,
> hence the reason for the text you quote to guarantee forward progress -
> otherwise a random store in the loop could accidentally match the exclusive
> granule and block progress. However I don't see it saying anywhere that all
> stores must clear the exclusive state.

That is for the global monitor which yes is depdenent on the granule.  But the
local monitor is taken into account too and you missed that. 
As mentioned in Section B2.9.2:
"For shareable memory locations, exclusive access instructions rely on:
• A local monitor for each PE in the system, that marks any address from which
the PE executes a
Load-Exclusive."

The local monitor is described in B2.9.1 and figure B2-4 which has the
following note about the local monitor state machine:
"The IMPLEMENTATION DEFINED options for the local monitor are consistent with
the local monitor being
constructed so that it does not hold any PA, but instead treats any access as
matching the address of the
previous Load-Exclusive instruction."

Reply via email to