You were right, it is a compiler bug!
The problem is a flag in -O2 level that is
-ftree-vrp and the default values of its parameters.
We can keep -O3 and add
--param=evrp-mode=legacy. From my understanding this param will instruct how the flag -ftree-vrp will perform. The default value for this param is ranger:
--param=evrp-mode=[legacy|ranger|legacy-first|ranger-first] default is "ranger"
It works fine with:
CFLAGS="-O3 --param=evrp-mode=legacy -march=native -maes -Wall"
I found some info related to this issue here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103603Aside from this, you are right about the resulting binary. It's working only in msys2 environment. It might work outside msys2 too, if we provide the path to the DLLs files.
It's just another way of doing it, and if it's possible, why not!
Confirmed. I did a quick performance test and it's equal to the existing Windows package. The test was done on a VM so
I'll have to try it on real HW.
.
All the dll's reported missing are there, but I haven't tried it yet. it's better than building them.