schwartz_adapter segfaults on the Travis GCC Windows build
The issue
Many of the schwartz_adapter tests segfault with the following configuration:
- 64-bit MinGW-w64
- Release mode
- Sorting a
wrapper<double>
Instead of just Release mode, we can reduce the issue to the following flags: -O2 -finline-functions -fpeel-loops -ftree-loop-vectorize -fno-omit-frame-pointer -g.
No amount of warnings, sanitizers, Valgring or static analyzers catch any issue in any configuration mode. It just segfaults with the configuration described above.
It looks like a codegen issue more than an actual programming error.
Legacy issue
While it works everywhere else (including my home computer where I use MinGW-w64), every test using schwartz_adapter segfaults in the new experimental travis-windows branch of the library when GCC is used, and only in Release mode.
It might be linked to #138, but if it's not the case finding the issue might prove more difficult.
I still don't understand where it comes from: I'm passing const lvalues to memory whose lifetime ends after all the machinery is done, so I don't understand where the segfaults might come from.
Cicada says it looks more and more like a codegen bug and managed to reduce the problematic optimization falgs to the following ones: -O2 -finline-functions -fpeel-loops -ftree-loop-vectorize -fno-omit-frame-pointer -g