Atomic accesses on ARM microcontrollers

Jonathan Wakely jwakely.gcc@gmail.com
Sat Oct 10 20:18:05 GMT 2020


On Sat, 10 Oct 2020 at 20:43, David Brown <david.brown@hesbynett.no> wrote:
> Is this strategy guaranteed to work in gcc, or is it a case of "it works
> in a simple test, but might fail in a complicated program or with
> different flags" ?

I think it works by design. My understanding is that users providing
their own implementation of those calls is fully supported. I think
that's partly why libatomic.so is a distinct library, and not just
part of libgcc_s.so. The docs aren't entirely clear about this, they
just say that if the compiler can't emit lock-free instructions for
the atomic operation "a call is made to an external routine with the
same parameters to be resolved at run time." But I think that "to be
resolved at run time" means that you can choose how those calls will
be resolved.


More information about the Gcc-help mailing list