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

            Bug ID: 118962
           Summary: Segmentation fault on Windows
           Product: gcc
           Version: 13.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rainer.bitschi at aon dot at
  Target Milestone: ---

Created attachment 60545
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60545&action=edit
source file c++

Provided program terminates with a segmentation fault on windows 11, Intel Core
i9-11900KF
Tested with multiple versions of gcc from https://winlibs.com/

BUT:
It does run on Ubuntu 24.04 with gcc on the same machine
It does run on Windows with msvc compiler on the same machine

I compile using:
g++ -g avxWrapper.cpp -o avxWrapper.exe -mavx512f

https://godbolt.org/z/TsThT54Kq

code:
-------------------------------------
#include <immintrin.h>
#include <iostream>

class V {
public:
    __m512 a;

    V(float value) : a { _mm512_set1_ps(value) } {}
    V(__m512 a) : a { a } {}

    V mul(V other) { return _mm512_mul_ps(a, other.a); }
};

int main() {
    V x = 2.5f;
    V y = 2.0f;
    V result = x.mul(y); //segmentation fault

    float data[16];
    _mm512_storeu_ps(data, result.a);
    std::cout << data[0] << std::endl;
    return 0;
}

Reply via email to