[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-02-08 Thread thomas.petazzoni--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #15 from Thomas Petazzoni  ---
(In reply to Michael Eager from comment #14)
> There is no reproducible test case in this bug report.  A report that
> buildroot has a build error is not a test case.

I'm not sure how to provide a reproducible test case without using Buildroot.

If you know how to cross-compile gcc for Microblaze, then if you just
cross-compile for Microblaze and build pretty much any C++ program, you'll
reproduce the issue.

> Creating a patch which only addressed the build failure would be
> problematic:  there would be no testing to verify that _atomic_test_and_set
> worked correctly.

I'm not interested in fixing just the build failure of course, but by a
complete fix that also works at runtime.

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-02-08 Thread eager at eagercon dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #14 from Michael Eager  ---
There is no reproducible test case in this bug report.  A report that buildroot
has a build error is not a test case.

Creating a patch which only addressed the build failure would be problematic: 
there would be no testing to verify that _atomic_test_and_set worked correctly.

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-02-08 Thread thomas.petazzoni--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #13 from Thomas Petazzoni  ---
(In reply to Michael Eager from comment #12)
> If you have a patch, please send it to [email protected]

Hm, I'm sorry, but I don't have a patch. My previous comment should have said
"Is there any update about this bug". Sorry the mistake.

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-28 Thread eager at eagercon dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #12 from Michael Eager  ---
If you have a patch, please send it to [email protected]

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-22 Thread thomas.petazzoni--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #11 from Thomas Petazzoni  ---
Is there any update about this patch? Should consider Microblaze
unmaintained/broken, and possibly drop support for it?

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-08 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #10 from Sam James  ---
(In reply to Andrew Pinski from comment #9)
> So Microblaze backend has only atomic_compare_and_swapsi  but that in theory
> could be used to implement smaller size atomics.
> Plus microblaze ISA has LWX/SWX (which is like LL/SC on MIPS), so that can
> be used to implement a few other atomics.

yes, and we manage to make-do on hppa too.

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #9 from Andrew Pinski  ---
So Microblaze backend has only atomic_compare_and_swapsi  but that in theory
could be used to implement smaller size atomics.
Plus microblaze ISA has LWX/SWX (which is like LL/SC on MIPS), so that can be
used to implement a few other atomics.
Why the backend never fully implemented all of the atomics is unknown to me.
Looks like it was added right after __atomics were finalized but originally was
only implemented using the __sync optabs.

https://gcc.gnu.org/pipermail/gcc-patches/2013-March/359295.html
https://gcc.gnu.org/pipermail/gcc-patches/2013-July/365984.html

And nobody afterwards did anything for the last 11 years to improve the
situtation.

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-08 Thread mikpelinux at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #8 from Mikael Pettersson  ---
According to glibc's sysdeps/microblaze/atomic-machine.h, microblaze cannot do
atomic operations on bytes or shorts, but __atomic_test_and_set is defined to
operate on a single byte, which would make it unimplementable on microblaze.

Still, seems to me that whoever uses the atomics should size them appropriately
for the target.

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-07 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P4

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-06 Thread thomas.petazzoni--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #7 from Thomas Petazzoni  ---
(In reply to Joseph S. Myers from comment #6)
> Are you *actually using the code built by recent GCC versions on Microblaze
> hardware running the Linux kernel* (as opposed to simply building software
> for lots of different targets that GCC claims to support)?

I am merely one of the co-maintainers of Buildroot, and we don't know which
architectures our users are targeting. For sure we have many more users
targeting x86/ARM/ARM64/RISC-V than we have people targeting Microblaze. But I
don't really know for sure what is our user base on Microblaze.

I personally don't really care much: if gcc decides that Microblaze is declared
orphaned and no longer maintained (and I would certainly understand that),
Buildroot will simply follow that and drop support for Microblaze. However as
it stands today, Microblaze seems supported by gcc, hence this bug report.

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-06 Thread jsm28 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #6 from Joseph S. Myers  ---
Are you *actually using the code built by recent GCC versions on Microblaze
hardware running the Linux kernel* (as opposed to simply building software for
lots of different targets that GCC claims to support)?

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-06 Thread thomas.petazzoni--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #5 from Thomas Petazzoni  ---
(In reply to Mikael Pettersson from comment #4)
> Note that a microblaze-unknown-linux-gnu toolchain builds just fine with
> gcc-14, glibc, and c++ enabled, so perhaps it's a _bit_ premature to
> deprecate it just because of these failures.

I confirm we have no problem building a Microblaze toolchain, but we have
serious issues building a large of software components with it due to this
atomic_test_and_set() problem.

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-05 Thread mikpelinux at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #4 from Mikael Pettersson  ---
Note that a microblaze-unknown-linux-gnu toolchain builds just fine with
gcc-14, glibc, and c++ enabled, so perhaps it's a _bit_ premature to deprecate
it just because of these failures.

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> The problem is r14-4286 exposed that microblaze had a broken definition of
> __atomic_test_and_set  .

This means nobody has been building microblaze since September 2023 which also
means maybe it should be declared as deprecated. Just as JSM mentioned here:
https://gcc.gnu.org/pipermail/gcc-patches/2025-January/672554.html

[Bug target/118280] [14/15 Regression] __atomic_test_and_set in Microblaze are broken (exposed by r14-4286)

2025-01-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Target Milestone|--- |14.3
Summary|undefined symbol|[14/15 Regression]
   |__atomic_test_and_set in|__atomic_test_and_set  in
   |libstdc++.so on Microblaze  |Microblaze are broken
   ||(exposed by r14-4286)
   Last reconfirmed||2025-01-05
 Status|UNCONFIRMED |NEW

--- Comment #2 from Andrew Pinski  ---
The problem is r14-4286 exposed that microblaze had a broken definition of
__atomic_test_and_set  .