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
```

Reply via email to