http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60689 --- Comment #2 from Jonathan Wakely --- when the object is bigger than the wordsize the generic __atomic_exchange gets expanded incorrectly $ g++11 aa.cc -DN=4 -m32 $ g++11 aa.cc -DN=5 -m32 aa.cc: In function ‘int main()’: aa.cc:10:49: error: invalid conversion from ‘S*’ to ‘unsigned int’ [-fpermissive] __atomic_exchange(&a, &b, &c, __ATOMIC_SEQ_CST); ^ aa.cc:10:49: error: invalid conversion from ‘int’ to ‘void*’ [-fpermissive] aa.cc:10:49: error: too few arguments to function ‘void __atomic_exchange(unsigned int, volatile void*, void*, void*, int)’ : note: declared here >From gcc-bugs-return-447669-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 27 20:47:48 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 30071 invoked by alias); 27 Mar 2014 20:47:48 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 30033 invoked by uid 48); 27 Mar 2014 20:47:44 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60689] Bogus error with atomic::exchange Date: Thu, 27 Mar 2014 20:47:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cc assigned_to attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg02538.txt.bz2 Content-length: 794 http://gcc.gnu.org/bugzilla/show_bug.cgi?id`689 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |jakub at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- Created attachment 32469 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id2469&actioníit gcc49-pr60689.patch Untested fix. 4.8 needs the same fix I think. In any case, no idea where to put a test for this. libstdc++-v3? libatomic? g++.dg and just make it compile test?