This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2, middle end]: Fix PR 37908, thinko with atomic NAND operation


Uros Bizjak wrote:
On Tue, Oct 28, 2008 at 11:04 PM, Jakub Jelinek <jakub@redhat.com> wrote:

Lu, Hongjiu wrote:
According to Dan, __sync_fetch_and_nand intrinsic should be implemented as ~(target & val). Uros's patch is correct.
At a minimum, it is incomplete.  If one were to change the semantics of
__sync_fetch_and_nand, they probably should do it universally rather
than just for a subset of GCC's targets.

The MIPS port would have to be changed, and IIRC sparc as well.
mips, alpha, ia64 and rs6000 to be precise.
And certainly big fat warning in the documentation, both in the builtins
section and in gcc-4.4 release notes.

Attached (now for real :) patch corrects __sync nand intrinsics to generate ~(target & val). The patch was tested on i686-pc-linux-gnu. I propose to commit the patch, since all unfixed targets will fail fixed sync tests and after all targets are fixed, we can backport complete patch to release branches and add the note to release notes.


What is the motivation for getting this into 4.4 two days before the end of stage3? It makes it more difficult for the maintainers of the ports you don't fix to have clean test results for 4.4.


As asked by APH in a different reply, Where are the nand intrinsics actually being used?

David Daney


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]