public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/113772] New: [14 Regression] atomic.d compile error since recent upstream imports.
@ 2024-02-05 16:10 iains at gcc dot gnu.org
  2024-02-05 16:12 ` [Bug d/113772] " iains at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: iains at gcc dot gnu.org @ 2024-02-05 16:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113772

            Bug ID: 113772
           Summary: [14 Regression] atomic.d compile error since recent
                    upstream imports.
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: iains at gcc dot gnu.org
  Target Milestone: ---
            Target: powerpc64-linux, powerpc-darwin

I am now seeing this on both Darwin and Linux BE powerpc.

The message is somewhat odd, since AFAICS from the core druntime code that
pulls in builtins.def which pulls in sync-builtins.def - which defines this
builtin.

If I check the C compiler manually, then the builtin works as expected - inline
for 1,2,4 bytes and out-of-line call to the atomic library for 8+ (32b PPC).

=====

/home/iains/gcc-master/src/libphobos/libdruntime/core/internal/atomic.d:612:53:
error: cannot evaluate unimplemented builtin ‘__atomic_is_lock_free’ at compile
time
  612 |     enum IsAtomicLockFree(T) = __atomic_is_lock_free(T.sizeof, null);
      |                                                     ^
../../../../../src/libphobos/libdruntime/core/stdc/stdatomic.d:65:30: error:
template instance ‘core.internal.atomic.IsAtomicLockFree!ulong’ error
instantiating
   65 |     ATOMIC_LLONG_LOCK_FREE = IsAtomicLockFree!ulong ? 2 : 0,

======

I wonder if that enum should also be guarded by
"static if (GNU_Have_Atomics || GNU_Have_LibAtomic)"

although that ought to make no difference since both the platforms mentioned
have support for libatomic.

-------

work-around:

    version (PPC)
    {
        enum IsAtomicLockFree(T) = T.sizeof <= 4;
    }
    else
    {
        enum IsAtomicLockFree(T) = __atomic_is_lock_free(T.sizeof, null);
    }

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-02-12 16:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05 16:10 [Bug d/113772] New: [14 Regression] atomic.d compile error since recent upstream imports iains at gcc dot gnu.org
2024-02-05 16:12 ` [Bug d/113772] " iains at gcc dot gnu.org
2024-02-05 17:39 ` ibuclaw at gdcproject dot org
2024-02-05 17:41 ` ibuclaw at gdcproject dot org
2024-02-05 17:51 ` iains at gcc dot gnu.org
2024-02-05 17:52 ` ibuclaw at gdcproject dot org
2024-02-05 18:04 ` iains at gcc dot gnu.org
2024-02-05 18:06 ` iains at gcc dot gnu.org
2024-02-05 18:27 ` ibuclaw at gdcproject dot org
2024-02-05 18:31 ` ibuclaw at gdcproject dot org
2024-02-05 18:32 ` ibuclaw at gdcproject dot org
2024-02-05 20:57 ` iains at gcc dot gnu.org
2024-02-05 22:50 ` ibuclaw at gdcproject dot org
2024-02-06  6:18 ` dkm at gcc dot gnu.org
2024-02-07 22:20 ` pinskia at gcc dot gnu.org
2024-02-08  2:48 ` doko at gcc dot gnu.org
2024-02-12 16:08 ` cvs-commit at gcc dot gnu.org
2024-02-12 16:20 ` ibuclaw at gdcproject dot org

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).