From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 00D9E385800C for ; Thu, 14 Sep 2023 09:06:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 00D9E385800C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694682418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OL3ksMpsNPNraYqYA0CWdJzzPmK+GZGev6a4GIPNsEA=; b=Dg539l7a5cJSG0JGFpVsLqIEhtw4fv3O4Bj7WeZQvgkhk8RrUrZOV+k9lrcFVdqGl5QKyM UDNWfPzOgrBr0zgF6DDR5xuCp/DoMCk0kIqQhFwuYuNOtyNm/elyiiec8XtpIpz59zRDsT nOJpBmD9ZQn5LDiOROH5I3UazAIdobY= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-647-KMBOCPC9PPuZmFdvaZRbPg-1; Thu, 14 Sep 2023 05:06:56 -0400 X-MC-Unique: KMBOCPC9PPuZmFdvaZRbPg-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2bcc1e0dfe5so9120811fa.1 for ; Thu, 14 Sep 2023 02:06:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694682415; x=1695287215; 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=OL3ksMpsNPNraYqYA0CWdJzzPmK+GZGev6a4GIPNsEA=; b=tQzthla4MBkxCdW+goCLZmUrSsmETmU/DNppUexAzGPztnIV5W81UjzqK7xIX4gXOT ye6edmTX43g7IwEeLsyioReYMAZtGJqG6V9eQmeqnoo+6da/jDidYC7oeMOOxDiD6u5d IlL233AHGndg8h/YSPvSnXrvbBgIPTkchTNuEMFlCv6n750CIf+018x9wmHNZ60rIYf0 Kue6jf42BuKCLEGUaFDHWC0b51lx6TbAH9pr+VX7Qtk8MWUQTp79mDROtgZIpNazu7a6 twXfAREla8Rfd1ZmywWDmhIVOoBXImRJWVhzgUjVQ5Hdrza9eFSt4ehe1sPF+S/RMyMp RqGQ== X-Gm-Message-State: AOJu0YxShzu6wdMWxlHRXuKpCyzwQ82FH7V0BAV5JGR9vA9ysk9X8MiW 5Y/nBf4b9x4+VNx/vN8Kh5EM+unX/toCIAdn8wIuaVaSTH+77F0xUAl5D9mmL/li963uUZsQKpO SyhE57e9tNWJ8QVxdQMYv7quS1Y9uyRw= X-Received: by 2002:a2e:9acb:0:b0:2bd:19c5:3950 with SMTP id p11-20020a2e9acb000000b002bd19c53950mr4859454ljj.33.1694682415558; Thu, 14 Sep 2023 02:06:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9wvBNns/MfAewDZM91plYf3q1/MLu33si5urNnbj59SoV0fqjjWR/UMZesK/9xdcj8QLvt9ZVhIDAjFD79tg= X-Received: by 2002:a2e:9acb:0:b0:2bd:19c5:3950 with SMTP id p11-20020a2e9acb000000b002bd19c53950mr4859438ljj.33.1694682415254; Thu, 14 Sep 2023 02:06:55 -0700 (PDT) MIME-Version: 1.0 References: <20230913123226.2083892-1-jwakely@redhat.com> In-Reply-To: From: Jonathan Wakely Date: Thu, 14 Sep 2023 10:06:44 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Remove some more unconditional uses of atomics To: Christophe Lyon Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: 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.