testsuite: tolerate compare_exchange_weak spurious failure

Alexandre Oliva oliva@adacore.com
Wed Mar 11 10:56:21 GMT 2026


On Mar 11, 2026, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:

> On Wed, 11 Mar 2026, 05:29 Alexandre Oliva, <oliva@adacore.com> wrote:
>> 
>> compare_exchange_weak is allowed to fail spuriously, and we're
>> actually hitting such spurious failures quite often on ppc-vx7r2,
>> presumably when random interrupts hit between ll and sc.
>> 
>> Tolerate one such failure, hopefully that will suffice.

> This is a bit of a problem, because we can't tell if the padding was
> cleared or not. If it was not clear, the first compare_exchange_weak would
> clear it, and the refund would succeed. But we want the test to fail in
> that case.

Erhm...  My understanding is that, when it returns false, no memory is
changed, so the second attempt would start from exactly the same state
as the first.

-- 
Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!


More information about the Libstdc++ mailing list