From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 9211E3858CDA for ; Thu, 14 Sep 2023 09:11:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9211E3858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9ad8a33fd0dso90813666b.3 for ; Thu, 14 Sep 2023 02:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694682680; x=1695287480; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RmC6Ar2TPb+Hrmc62O5rPr6Rel1l+Vp+PeLnm3NjZMA=; b=EYtS/QjkLrtDtclGZrvpsblgwTK5PHLMcgVieNtZvLcqLiFWfIv+FvOo6QhhfXIP2r pin6TwgUWIzEke+k1rB1vaM7NPLyNgiJ5RhjsLEZ1FHF2B4HGNtRFCeyRVmlQJmk9zAq njFOFhVQLvkAFA/aa+gOEPo3tqDEEE5X5/fOJfDwdCljmAOxnGtWA8AISjlS6cO5KPOP uobME3/LMoe6i2Hw5b2IgQYdZ5jim0W+5BpXh8zTs5qVT5qjii+gM7vXsP1M1uvkSe2B 6nbiIMkuQuX/hhUqmIn6oWjeER8Rw9rivSBU3ysB3O8/FUU3QmTjUX2JbYz0eKxVAhuG i35Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694682680; x=1695287480; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RmC6Ar2TPb+Hrmc62O5rPr6Rel1l+Vp+PeLnm3NjZMA=; b=LtPyPtj3d70QENfwG70nmyUBaY9dAbSEiU924pVor8lLGtF6/HBfSX4rRR4UdB51VR opxbaWV+meG7ZdCTXQWsaAwjvVwAglnV29Yu1d3vCKsRQIqwumpPhIzJexC0suuj5LrO vtBipoj9BlO+c17qQEuxEdNuuq5ASO/t90oZFivmecrqrbVLE5L6OuqdUXArHWCyKdKW LbBtUY57PZE1wlUqhuL4FYHfB+cs6FEF/6g0pfwbjhNzJh9wSajWw/MhAP/s9yNZx+fK 6Qzy7eo3dssRn+kXwegoxlEX7+KXFdwbF7M8EJhfty0qeoyeea/8/PL+B89sfbBTSX+m sozg== X-Gm-Message-State: AOJu0YyhLHW6CUtS82fpOjg570Qe0t/IE8d4g/oE2S0iPPMzgA7oZScy J2quKAggQXQjevXVP9JPeuI/SGATmDE3+Jrg9tSA8A== X-Google-Smtp-Source: AGHT+IENjmzBs5L9D1KMu1xeCgCK1+kflGYnCxnMpwLiFGgSCpDnKa9GkmKkngB04UVWRLvwkw6XHB7y91h83qEynWE= X-Received: by 2002:a17:907:77c2:b0:9a1:f21e:cdfc with SMTP id kz2-20020a17090777c200b009a1f21ecdfcmr4010116ejc.41.1694682680162; Thu, 14 Sep 2023 02:11:20 -0700 (PDT) MIME-Version: 1.0 References: <20230913123226.2083892-1-jwakely@redhat.com> In-Reply-To: From: Christophe Lyon Date: Thu, 14 Sep 2023 11:11:11 +0200 Message-ID: Subject: Re: [PATCH] libstdc++: Remove some more unconditional uses of atomics To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000289aaf06054e0f08" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000289aaf06054e0f08 Content-Type: text/plain; charset="UTF-8" On Thu, 14 Sept 2023 at 11:06, Jonathan Wakely wrote: > On Thu, 14 Sept 2023 at 09:41, Christophe Lyon > wrote: > > > > > > > > On Thu, 14 Sept 2023 at 10:17, Jonathan Wakely > wrote: > >> > >> On Thu, 14 Sept 2023 at 08:44, Christophe Lyon > >> wrote: > >> > > >> > Hi, > >> > > >> > > >> > On Wed, 13 Sept 2023 at 14:32, Jonathan Wakely > wrote: > >> >> > >> >> Tested x86_64-linux and aarch64-linux. I intend to push this to > trunk. > >> >> > >> >> -- >8 -- > >> >> > >> >> These atomics cause linker errors on arm4t where __sync_synchronize > is > >> >> not defined. For single-threaded targets we don't need the atomics. > >> >> > >> > > >> > I ran the tests on arm-eabi default config (so, armv4t) with this > patch, and here is the list of remaining UNRESOLVED tests: > >> > 29_atomics/atomic/compare_exchange_padding.cc > >> > 29_atomics/atomic/cons/value_init.cc > >> > 29_atomics/atomic_float/value_init.cc > >> > 29_atomics/atomic_integral/cons/value_init.cc > >> > 29_atomics/atomic_ref/compare_exchange_padding.cc > >> > 29_atomics/atomic_ref/generic.cc > >> > 29_atomics/atomic_ref/integral.cc > >> > 29_atomics/atomic_ref/pointer.cc > >> > experimental/polymorphic_allocator/construct_pair.cc > >> > > >> > all of them are due to undefined reference to __sync_synchronize > >> > (some also reference __atomic_compare_exchange_4, etc...) > >> > > >> > > >> > IIUC, this should not be the case for > experimental/polymorphic_allocator/construct_pair.cc ? > >> > The reference for __sync_synchronize is near the beginning of > test0[123] > >> > from a call to __atomic_load_n line 835 of atomic_base.h > >> > not sure where it comes from, the .loc directive indicates line 28 of > the testcase which is the opening brace > >> > >> Doh, I removed the atomics from but this is > >> , which has a separate implementation. > >> > >> I'll make a change to as well, thanks > >> for catching my silly mistake. > >> > > > > You're welcome. > > So I'll shrink my patch and add dg-require-thread-fence only to the few > 29_atomics tests listed above. > > Great, thanks. That's approved for trunk then. > > N.B. if you'd prefer to add { dg-require-effective-target thread_fence > } instead of { dg-require-thread-fence "" } then that's fine, just > note that the effective target uses an underscore not a hyphen. The > dg-require-thread-fence proc just uses the proc that checks the > thread_fence effective target, so both forms do the same thing. > > Ha! Just sent v2, I kept dg-require-thread-fence, because it was used elsewhere in the libstsdc++ testsuite. Thanks, Christophe --000000000000289aaf06054e0f08--