On Mon, Nov 18, 2013 at 9:09 AM, Ian Lance Taylor <i...@google.com> wrote: > On Mon, Nov 18, 2013 at 5:39 AM, Jakub Jelinek <ja...@redhat.com> wrote: > >> 3) I wonder if libbacktrace couldn't be updated to use __atomic_* builtins, >> then it could avoid the ugliness to emulate atomic loads and stores. > > I think that would be fine. I can't remember why I didn't use the > __atomic builtins. Maybe they weren't quite ready at the time.
Wait, I remember the reason. It's because we compile libbacktrace with the host compiler so that it can be linked with GCC itself, and it seems premature to assume that the host compiler supports the __atomic builtins. Of course we could use configure tests and so forth, but the code to implement atomic loads using the sync builtins is simple enough that I'm not sure it's worth it. Ian