This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/78357] nios2 uses non-standard atomic functions
- From: "sebastian dot huber at embedded-brains dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Nov 2016 10:39:52 +0000
- Subject: [Bug target/78357] nios2 uses non-standard atomic functions
- Auto-submitted: auto-generated
- References: <bug-78357-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78357
--- Comment #2 from Sebastian Huber <sebastian.huber@embedded-brains.de> ---
(In reply to Chung-Lin Tang from comment #1)
> Sebastian, I'm not sure what your problem is. The atomics in nios2 are
> implemented by __sync_* functions placed in libgcc. The built-in function
> expansion inside GCC is aware of this, and __atomic_* functions get mapped
> to those. Is there anything affecting your use?
I think this mapping of __atomic_* functions to __sync_* functions is
wrong/outdated. Is this a speciality of the Nios II support? I am not aware
of a second target support in GCC which does this. The __sync_* builtins are a
legacy API:
https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html#g_t_005f_005fsync-Builtins
>
> libatomic is usually supported by those targets with more "rich" atomic
> instructions, and nios2 in its current form is obviously not one of them.
The libatomic is for architectures which lack atomic instructions.