http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50457
--- Comment #4 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-09-25 00:53:23 UTC --- (In reply to comment #3) > I don't know how linux/glibc have been handling atomic ops on SH2 or SH2A, but > I've got an idea that would work in a bare-metal setup. There is no glibc port for SH2* and highly unlikely someone will add it. SH2* linux uses and will use totally different environment instead of glibc/nptl. Those CPUs have no user/privilege modes and folks tend to use disable/enable interrupts for the atomicity on them like as in #0. *-linux configuration of gcc assumes glibc/nptl everywhere. It means that only sh[34]*-linux configuration will work well. For this PR, the current atomic functions or builtins should be disabled for sh2*-linux configuration and add something that works on SH2*. You would have a free hand to the implementation in this case, since currently there is nothing correct for SH2*.