public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113549] New: float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c
@ 2024-01-22 21:10 nightstrike at gmail dot com
  2024-01-22 21:11 ` [Bug target/113549] " nightstrike at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: nightstrike at gmail dot com @ 2024-01-22 21:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113549
           Summary: float simd crash on windows in
                    gcc.dg/vect/vect-simd-clone-16b.c
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

Created attachment 57187
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57187&action=edit
Assembly output

The vect-simd-clone-16b.c test runs the vect-simd-clone-16.c test with the TYPE
set to float.  The default type is int, which works fine.  Reducing that
testcase yields the following:


```
#define TYPE float
#pragma omp declare simd inbranch
TYPE __attribute__((noinline))
foo (TYPE a)
{
  return a + 1;
}

void
masked_fixed (TYPE * a, TYPE * b)
{
  #pragma omp simd
  for (int i = 0; i < 128; i++)
    b[i] = a[i]<1 ? foo(a[i]) : a[i];
}

int main() {
        TYPE a[1024] = {0};
        TYPE b[1024] = {0};
        masked_fixed(a, b);
        return 0;
}
```

The noipa attribute and the __restrict keywords were removed from masked_fixed.
 noinline is required on foo.


Minimal set of compile arguments required to trigger the problem:
$ x86_64-w64-mingw32-gcc  a.c -fopenmp-simd -O2 -mavx

Note that dropping to -01 or removing -mavx avoids the crash.  

Assembly from -save-temps -fverbose-asm attached.

This is technically running under wine 8.0.  This is the backtrace provided by
wine:

```
wine: Unhandled page fault on read access to FFFFFFFFFFFFFFFF at address
000000014000163F (thread 0024), starting debugger...
Unhandled exception: page fault on read access to 0xffffffffffffffff in 64-bit
code (0x0000014000163f).
Register dump:
 rip:000000014000163f rsp:000000000021dc50 rbp:000000000021dcd0 eflags:00010246
(  R- --  I  Z- -P- )
 rax:0000000000000000 rbx:0000000000000000 rcx:000000000021dcf0
rdx:000000000021dcd0
 rsi:000000000021ed70 rdi:000000000021dd70  r8:000000000021dcb0 
r9:0000000000c92000 r10:0000000000c90330
 r11:0000000000000000 r12:000000000021dcb0 r13:000000000021dcf0
r14:0000000000000000 r15:0000000000000000
Stack dump:
0x0000000021dc50:  0000000000000000 0000000000000000
0x0000000021dc60:  0000000000000000 0000000000000000
0x0000000021dc70:  0000000000000000 0000000000000000
0x0000000021dc80:  0000000000000000 0000000000000000
0x0000000021dc90:  0000000000000000 0000000000000000
0x0000000021dca0:  0000000000000000 0000000000000000
0x0000000021dcb0:  0000000000000000 0000000000000000
0x0000000021dcc0:  0000000000000000 0000000000000000
0x0000000021dcd0:  0000000000000000 0000000000000000
0x0000000021dce0:  0000000000000000 0000000000000000
0x0000000021dcf0:  0000000000000000 0000000000000000
0x0000000021dd00:  0000000000000000 0000000000000000
Backtrace:
=>0 0x0000014000163f in a (+0x163f) (0x0000000021dcd0)
  1 0x00000140003384 in a (+0x3384) (0x0000000021fdf0)
  2 0x00000140001340 in a (+0x1340) (0x0000000021fdf0)
  3 0x00000140001146 in a (+0x1146) (0x0000000021fe30)
  4 0x0000007b647b51 BaseThreadInitThunk+0x11(unknown=<internal error>,
entry=<internal error>, arg=<internal error>)
[H:\home\user\p\gcc\src\wine-8.0-rc4p2p3\dlls\kernel32\thread.c:61] in kernel32
(0x00000
00021fe60)
0x0000014000163f a+0x163f: ldsl %esp,%edi
```

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

* [Bug target/113549] float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c
  2024-01-22 21:10 [Bug target/113549] New: float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c nightstrike at gmail dot com
@ 2024-01-22 21:11 ` nightstrike at gmail dot com
  2024-01-22 21:14 ` nightstrike at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: nightstrike at gmail dot com @ 2024-01-22 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from nightstrike <nightstrike at gmail dot com> ---
Created attachment 57188
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57188&action=edit
Failing source for easier copying

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

* [Bug target/113549] float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c
  2024-01-22 21:10 [Bug target/113549] New: float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c nightstrike at gmail dot com
  2024-01-22 21:11 ` [Bug target/113549] " nightstrike at gmail dot com
@ 2024-01-22 21:14 ` nightstrike at gmail dot com
  2024-01-22 21:22 ` pinskia at gcc dot gnu.org
  2024-01-22 23:20 ` nightstrike at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: nightstrike at gmail dot com @ 2024-01-22 21:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from nightstrike <nightstrike at gmail dot com> ---
Test 16e uses double instead of float, which also crashes.

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

* [Bug target/113549] float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c
  2024-01-22 21:10 [Bug target/113549] New: float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c nightstrike at gmail dot com
  2024-01-22 21:11 ` [Bug target/113549] " nightstrike at gmail dot com
  2024-01-22 21:14 ` nightstrike at gmail dot com
@ 2024-01-22 21:22 ` pinskia at gcc dot gnu.org
  2024-01-22 23:20 ` nightstrike at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-22 21:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Either the stack size or the stack alignment issue.

I am suspecting a stack alignement issue.

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

* [Bug target/113549] float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c
  2024-01-22 21:10 [Bug target/113549] New: float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c nightstrike at gmail dot com
                   ` (2 preceding siblings ...)
  2024-01-22 21:22 ` pinskia at gcc dot gnu.org
@ 2024-01-22 23:20 ` nightstrike at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: nightstrike at gmail dot com @ 2024-01-22 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from nightstrike <nightstrike at gmail dot com> ---
(In reply to Andrew Pinski from comment #3)
> Either the stack size or the stack alignment issue.
> 
> I am suspecting a stack alignement issue.

Possibly related: PR110273

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

end of thread, other threads:[~2024-01-22 23:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 21:10 [Bug target/113549] New: float simd crash on windows in gcc.dg/vect/vect-simd-clone-16b.c nightstrike at gmail dot com
2024-01-22 21:11 ` [Bug target/113549] " nightstrike at gmail dot com
2024-01-22 21:14 ` nightstrike at gmail dot com
2024-01-22 21:22 ` pinskia at gcc dot gnu.org
2024-01-22 23:20 ` nightstrike at gmail dot com

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