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

--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Looking at
https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html#index-_005f_005fatomic_005fload
I see this signature for __atomic_load with 3 arguments:

Built-in Function: void __atomic_load (type *ptr, type *ret, int memorder)

and that's what I tried to implement in r14-1497-gef768035ae8090 in kf.cc's
class kf_atomic_load.

However, looking at the gimple, I see this call:

  __atomic_load (128, &s, &r, 0);

and sync-builtins.def has this:

DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD,
                  "__atomic_load",
                  BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT,
                  ATTR_NOTHROWCALL_LEAF_LIST)

so presumably the documentation for __atomic_load is wrong.

Presumably the signature should be:

void __atomic_load (size_t sz, const void *src, void *dst, int memorder);

Reply via email to