Enable strict aliasing for release builds
This commit is contained in:
parent
e0afec7743
commit
9d3f982f52
3 changed files with 6 additions and 3 deletions
5
.github/workflows/linux.yml
vendored
5
.github/workflows/linux.yml
vendored
|
@ -101,7 +101,10 @@ jobs:
|
|||
CXX: ccache g++
|
||||
LD: gcc
|
||||
RANLIB: gcc-ranlib
|
||||
FLAGS: -O3 -flto -ffunction-sections -fdata-sections -DNDEBUG -pipe
|
||||
FLAGS: >-
|
||||
-O3 -fstrict-aliasing -fno-signed-zeros -fno-trapping-math
|
||||
-fassociative-math -mfpmath=sse -msse4.2 -flto -ffunction-sections
|
||||
-fdata-sections -DNDEBUG -pipe
|
||||
LINKFLAGS: -Wl,--as-needed
|
||||
run: |
|
||||
set -x
|
||||
|
|
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
|
@ -58,7 +58,7 @@ jobs:
|
|||
env:
|
||||
CC: ccache clang
|
||||
CXX: ccache clang++
|
||||
FLAGS: -O3 -DNDEBUG -pipe -march=nehalem
|
||||
FLAGS: -DNDEBUG -O3 -fno-math-errno -fstrict-aliasing -march=nehalem -flto=thin -pipe
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Install C++ compiler and libraries
|
||||
|
|
|
@ -15,7 +15,7 @@ cflags_debug+=("${cflags[@]}" -g -fno-omit-frame-pointer)
|
|||
# Note: associative-math is needed for vectorization of floating point
|
||||
# calculations, which also relies on no-signed-zeros and
|
||||
# no-trapping-math.
|
||||
cflags_release+=("${cflags[@]}" -DNDEBUG -O3 -fno-strict-aliasing
|
||||
cflags_release+=("${cflags[@]}" -DNDEBUG -O3 -fstrict-aliasing
|
||||
-fno-signed-zeros -fno-trapping-math -fassociative-math
|
||||
-frename-registers -ffunction-sections -fdata-sections)
|
||||
cflags_pgotrain+=("${cflags_debug[@]}" -pg -ftree-vectorize)
|
||||
|
|
Loading…
Add table
Reference in a new issue