From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21551 invoked by alias); 28 Jan 2015 20:38:24 -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 Received: (qmail 15387 invoked by uid 48); 28 Jan 2015 20:38:15 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/64843] miscompilation of atomic_fetch_add on atomic pointer type Date: Wed, 28 Jan 2015 20:38: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: documentation, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords bug_status cf_reconfirmed_on everconfirmed cf_known_to_fail 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: 2015-01/txt/msg03302.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |documentation, wrong-code Status|UNCONFIRMED |NEW Last reconfirmed| |2015-01-28 Ever confirmed|0 |1 Known to fail| |5.0 --- Comment #1 from Richard Biener --- The documentation indeed suggests this: "These built-in functions perform the operation suggested by the name, and return the value that had previously been in @code{*@var{ptr}}. That is, @smallexample @{ tmp = *ptr; *ptr @var{op}= val; return tmp; @} @end smallexample" thus here *(&p) += 1; Whether the bug is in documentation or code is another question. Confirmed that the testcase produces cited assembly on x86_64 and some older trunk.