From 2ebad737eea219e414ca6d912af13e9f92fa4019 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Fri, 8 Dec 2023 17:08:44 +1000 Subject: [PATCH] build: enable strict aliasing optimisations Extensive code quality improvements have been made since this was last tried, and compilers are smarter with better warnings now. This doesn't change the Xonotic pipeline gameplay hash so it's highly unlikely to cause any subtle regressions. Signed-off-by: bones_was_here --- makefile.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefile.inc b/makefile.inc index ff2a68df..d68421fe 100644 --- a/makefile.inc +++ b/makefile.inc @@ -201,7 +201,8 @@ OPTIM_DEBUG=$(CPUOPTIMIZATIONS) #OPTIM_RELEASE=-O2 -fno-strict-aliasing -funroll-loops $(CPUOPTIMIZATIONS) #OPTIM_RELEASE=-O2 -fno-strict-aliasing $(CPUOPTIMIZATIONS) #OPTIM_RELEASE=-O3 -fno-strict-aliasing $(CPUOPTIMIZATIONS) -OPTIM_RELEASE=-O3 -fno-strict-aliasing -fno-math-errno -fno-trapping-math $(CPUOPTIMIZATIONS) +#OPTIM_RELEASE=-O3 -fno-strict-aliasing -fno-math-errno -fno-trapping-math $(CPUOPTIMIZATIONS) +OPTIM_RELEASE=-O3 -fno-math-errno -fno-trapping-math $(CPUOPTIMIZATIONS) # NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag # Also, since gcc 5, -ffinite-math-only makes NaN and zero compare equal inside engine code but not inside QC, which causes error spam for seemingly valid QC code like if (x != 0) return 1 / x; -- 2.39.2