> I see.  Those return integer types and hence aren't convertible to struct
> types either (not even with a cast).  This doesn't (and shouldn't)
> compile:
This is because it's not supposed to be called directly. These calls
are _generated_, they're not some kind of manual call.
From GCC's point of view, they fall into a set of "optimized
routines". From LLVM's, they're generated.
They're simply implementation details.

Calling atomic_load on a single-byte value can lead to __atomic_load_1 routine.
But this routine (which, as it seems, should have its own symbol) is
_not_ an intrinsic.
This is a "generated" call, or "optimized routine" (depending on which
docs to read).

Calling atomic_load on some struct or union which acts as a
single-byte value can lead to __atomic_load_1 routine being invoked.
I don't see a contradiction here. You don't have to match the return
type, this is a generated call, as long as semantics matches, it's OK.
This is not a literal attempt to do `struct compatible_to_type1 comp1
= __atomic_load_1(&atomic)`. This is just about the code generation.

Moreover, this even applies to inline. Implementations can (and will!)
inline the code which corresponds to __atomic_load_1.
I don't know what example you're looking for. What I want is to
implement what's described in the documentation.

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to