public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Christophe Lyon <christophe.lyon@linaro.org>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: Remove some more unconditional uses of atomics
Date: Thu, 14 Sep 2023 10:06:44 +0100	[thread overview]
Message-ID: <CACb0b4=a4vVoOzJKJymNGkLaFXz1AX2XXLqmh_FSQ+CJT6Wxmw@mail.gmail.com> (raw)
In-Reply-To: <CAPS5khafJ94qRQjEA6gActTbv6LYk0xapVe2ro5AghWj_tih8g@mail.gmail.com>

On Thu, 14 Sept 2023 at 09:41, Christophe Lyon
<christophe.lyon@linaro.org> wrote:
>
>
>
> On Thu, 14 Sept 2023 at 10:17, Jonathan Wakely <jwakely@redhat.com> wrote:
>>
>> On Thu, 14 Sept 2023 at 08:44, Christophe Lyon
>> <christophe.lyon@linaro.org> wrote:
>> >
>> > Hi,
>> >
>> >
>> > On Wed, 13 Sept 2023 at 14:32, Jonathan Wakely <jwakely@redhat.com> 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 <memory_resource> but this is
>> <experimental/memory_resource>, which has a separate implementation.
>>
>> I'll make a change to <experimental/memory_resource> 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.


  reply	other threads:[~2023-09-14  9:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 12:31 Jonathan Wakely
2023-09-14  7:43 ` Christophe Lyon
2023-09-14  8:17   ` Jonathan Wakely
2023-09-14  8:41     ` Christophe Lyon
2023-09-14  9:06       ` Jonathan Wakely [this message]
2023-09-14  9:11         ` Christophe Lyon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACb0b4=a4vVoOzJKJymNGkLaFXz1AX2XXLqmh_FSQ+CJT6Wxmw@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).