[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-09-01 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

--- Comment #12 from GCC Commits  ---
The master branch has been updated by Tobias Burnus :

https://gcc.gnu.org/g:42bcdfa5cb64724dc0b6f1fdcdd537aa2bbefac3

commit r16-3487-g42bcdfa5cb64724dc0b6f1fdcdd537aa2bbefac3
Author: Tobias Burnus 
Date:   Mon Sep 1 12:41:41 2025 +0200

install.texi: For amdgcn, update Newlib version recommendation

Add two Newlib commits to the recommended Newlib version,
fixing two other SIMD issues.
Cf. PR target/121392 and Newlib Bug 33272.

gcc/ChangeLog:

PR target/121392
* doc/install.texi (amdgcn): Mention Newlib commit
that fixes another SIMD issue.

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-08-27 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

--- Comment #11 from Tobias Burnus  ---
(In reply to Tobias Burnus from comment #10)
> (In reply to Andrew Stubbs from comment #9)
> > I have submitted a Newlib patch for the related issue.
> 
> Namely, https://sourceware.org/pipermail/newlib/2025/022100.html

Now committed as
https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=bd409f3c12e28e1464dec7fd0d45db30280f1e56

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-08-27 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

--- Comment #10 from Tobias Burnus  ---
(In reply to Andrew Stubbs from comment #9)
> I have submitted a Newlib patch for the related issue.

Namely, https://sourceware.org/pipermail/newlib/2025/022100.html

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-08-27 Thread ams at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

--- Comment #9 from Andrew Stubbs  ---
I have submitted a Newlib patch for the related issue.

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-08-18 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

--- Comment #8 from Tobias Burnus  ---
As cross-ref: The same issue still exists, but more intermittently.
That's tracked as Newlib bug number 33272 on Sourceware (see 'See Also', link
was added 6 days ago).

The assumption is the same: The better vectorization on the GCC side causes
preexisting bugs to show up (whether in the lib or code gen has to be
debugged).

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

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

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |MOVED
 Status|ASSIGNED|RESOLVED

--- Comment #7 from Andrew Pinski  ---
(In reply to Tobias Burnus from comment #6)
> (In reply to Andrew Stubbs from comment #3)
> > Patch submitted: https://sourceware.org/pipermail/newlib/2025/022077.html
> 
> The patch was applied in commit f13e8e21599ff12ea76980d6a8b19b0a5ebe9bed
> 
> https://sourceware.org/git/?p=newlib-cygwin.git;a=commit;
> h=f13e8e21599ff12ea76980d6a8b19b0a5ebe9bed

So marked as moved.

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-08-09 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

Tobias Burnus  changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu.org

--- Comment #6 from Tobias Burnus  ---
(In reply to Andrew Stubbs from comment #3)
> Patch submitted: https://sourceware.org/pipermail/newlib/2025/022077.html

The patch was applied in commit f13e8e21599ff12ea76980d6a8b19b0a5ebe9bed

https://sourceware.org/git/?p=newlib-cygwin.git;a=commit;h=f13e8e21599ff12ea76980d6a8b19b0a5ebe9bed

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

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

--- Comment #5 from Thomas Schwinge  ---
(In reply to myself from comment #4)
> But why only for 'HSA_XNACK=1' but not without

Having tested a few more times, it also reproduces without 'HSA_XNACK=1'.

> and why only on one of the two gfx90a systems but not the
> other?  (Nothing in 'dmesg'.)

..., because I had 'ROCR_VISIBLE_DEVICES' set corresponding to the other
system...  I'm now reproducing the occasional hang on both gfx90a systems.

(I've not extensively tested any others systems/AMD GPU architectures; maybe
it's indeed a general issue that only occurs occasionally?  Some uninitialized
variable issue, maybe?)

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

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

--- Comment #4 from Thomas Schwinge  ---
The is one additional strange thing: as I reported elsewhere, the newlib patch
generally resolves the issue, but on one of our two AMD gfx90a systems, when
running 'libgomp.c/simd-math-1.c' with 'HSA_XNACK=1', it hangs, for example, in
4 out of 13 runs, and when SIGINTed, always produces a backtrace similar to:

(gdb) r
Starting program: [...]/simd-math-1.exe 
[...]
^C
Thread 1 "simd-math-1.exe" received signal SIGINT, Interrupt.
__GI___ioctl (fd=3, request=3222817548) at
../sysdeps/unix/sysv/linux/ioctl.c:36
36  ../sysdeps/unix/sysv/linux/ioctl.c: No such file or directory.
(gdb) bt
[...]
#6  0x7786a699 in ?? () from /opt/rocm/lib/libhsa-runtime64.so.1
#7  0x77e5d1cb in run_kernel (kernel=kernel@entry=0x99af00,
vars=vars@entry=0x7ffef420, kla=, aq=aq@entry=0x0,
module_locked=module_locked@entry=false) at
[...]/source-gcc/libgomp/plugin/plugin-gcn.c:2382
#8  0x77e63aa5 in GOMP_OFFLOAD_run (device=,
fn_ptr=0x99af00, vars=0x7ffef420, args=0x7fffa9d0) at
[...]/source-gcc/libgomp/plugin/plugin-gcn.c:4933
#9  0x77ea5c05 in GOMP_target_ext (device=device@entry=-1,
fn=fn@entry=0x40aeb0 , mapnum=mapnum@entry=3,
hostaddrs=hostaddrs@entry=0x7fffab00, sizes=sizes@entry=0x59e440
, kinds=kinds@entry=0x59e430 ,
flags=, depend=, args=) at
[...]/source-gcc/libgomp/target.c:3358
#10 0x0040b19d in test_fmod () at
../source-gcc/libgomp/testsuite/libgomp.c/simd-math-1.c:200
#11 0x004024f9 in main () at
../source-gcc/libgomp/testsuite/libgomp.c/simd-math-1.c:200

Note that this again points to 'fmod'?  But why only for 'HSA_XNACK=1' but not
without, and why only on one of the two gfx90a systems but not the other? 
(Nothing in 'dmesg'.)

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-08-07 Thread ams at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

Andrew Stubbs  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |ams at gcc dot gnu.org
   Last reconfirmed||2025-08-07
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #3 from Andrew Stubbs  ---
Patch submitted: https://sourceware.org/pipermail/newlib/2025/022077.html

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-08-05 Thread ams at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

--- Comment #2 from Andrew Stubbs  ---
This is actually a bug in Newlib libm that is exposed because the testcase is
now vectorizing, where previously the i386 setting of
param_vect_partial_vector_usage was blocking it.

>From newlib/libm/machine/amdgcn/v64sf_fmod.c:

  VECTOR_IF (hy < 0x0080, cond)// subnormal y 
iy = VECTOR_INIT (-126);   
for (v64si i = (hy << 8); !ALL_ZEROES_P (cond & (i >= 0)); i <<= 1)
  VECTOR_COND_MOVE (iy, iy - 1, cond & (i >= 0));  

Here the bug is that "i <<= 1" continues to run until the last lane is
finished, which results in some lanes getting shifted too far, which causes
those lanes to become zero, resulting in an infinite loop.

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-08-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |16.0

[Bug target/121392] [16 Regression] GCN offloading: 'libgomp.c/simd-math-1.c' execution test timeouts

2025-08-04 Thread ams at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121392

--- Comment #1 from Andrew Stubbs  ---
The i386 host platform was avoiding the amdgcn backend bug by basically
disabling vectorization on arrays known to be smaller than 64 elements.  Now
that the option pass-through is removed, we're seeing previously hidden bugs
(and also improved performance where its not broken).

I'll take a look soon.