From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29974 invoked by alias); 1 Oct 2012 23:39:29 -0000 Received: (qmail 29892 invoked by uid 48); 1 Oct 2012 23:39:14 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/50457] SH2A atomic functions Date: Mon, 01 Oct 2012 23:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-10/txt/msg00072.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50457 --- Comment #10 from Oleg Endo 2012-10-01 23:39:12 UTC --- (In reply to comment #9) > (In reply to comment #8) > > Would that be OK to do? > > Yes, that sounds good for maintenance. OK, I've already got something here, but I'm confused about one thing. In config/sh/linux-atomic.S the function names go like ... .global __sync_lock_test_and_set_##N; \ HIDDEN_FUNC(__sync_lock_test_and_set_##N); \ (two leading underscores) When no atomic model is selected the compiler will turn this int test (int* x, int y, int z) { return __sync_val_compare_and_swap (x, y, z); } into: .global _test .type _test, @function _test: mov.l .L2,r0 ! 11 movsi_ie/1 [length = 2] jmp @r0 nop ! 12 sibcall_valuei [length = 4] .L3: .align 2 .L2: .long ___sync_val_compare_and_swap_4 (three leading underscores) Looking at config/arm/linux-atomic.c, the C functions all start with two leading underscores, which will result in three leading underscores in the .asm file. How does this fit together in the SH case? The compiler generates refs to '___sync*' but in the .S file there are only '__sync' symbols. I'm afraid I'm missing something here...