This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/86005] [RISCV] Invalid intermixing of __atomic_* libcalls and inline atomic instruction sequences
- From: "wilson at tuliptree dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 31 May 2018 20:10:06 +0000
- Subject: [Bug target/86005] [RISCV] Invalid intermixing of __atomic_* libcalls and inline atomic instruction sequences
- Auto-submitted: auto-generated
- References: <bug-86005-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86005
--- Comment #6 from Jim Wilson <wilson at tuliptree dot org> ---
On Thu, 2018-05-31 at 15:07 +0000, foom at fuhm dot net wrote:
> (But also, why doesn't it implement __atomic_add_fetch inline?)
If you don't have atomic instructions, then we call an out-of-line
function that uses locks.
If you have atomic instructions, and it is a 32/64-bit operation, then
we inline it.
If you have atomic instructions, and it is a 8/16-bit operation, then
we call a lock free out-of-line function that uses a sequence of
instructions to implement it using 32/64-bit atomic instructions. And
as mentioned previously, I have an unfinished prototype patch to fix
this by emitting the sequence of instructions inline.