From 4e82091f92caca929b2ee9d1da36427090ea34ad Mon Sep 17 00:00:00 2001 From: Sam James Date: Fri, 31 Jan 2025 19:45:14 +0000 Subject: [PATCH] Codechange: use -fno-strict-enums instead of -fno-tree-vrp (#13369) -fno-tree-vrp is essentially a GCC implementation detail which controls a powerful source of optimisation information. The linked GCC bug from 2010(!) shows that -fno-strict-enums was added in response to the bug report, and we can use that instead. Clang supports it too. Use that instead for both GCC and (newly) Clang. --- cmake/CompileFlags.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake index 2f62a7b8b5..1f613e9377 100644 --- a/cmake/CompileFlags.cmake +++ b/cmake/CompileFlags.cmake @@ -80,6 +80,10 @@ macro(compile_flags) # We use 'ABCD' multichar for SaveLoad chunks identifiers -Wno-multichar + + # Prevent optimisation supposing enums are in a range specified by the standard + # For details, see http://gcc.gnu.org/PR43680 and PR#5246. + -fno-strict-enums ) # Ninja processes the output so the output from the compiler @@ -106,10 +110,6 @@ macro(compile_flags) # about its own optimized code in some places. "-fno-strict-overflow" - # Prevent optimisation supposing enums are in a range specified by the standard - # For details, see http://gcc.gnu.org/PR43680 - "-fno-tree-vrp" - # -flifetime-dse=2 (default since GCC 6) doesn't play # well with our custom pool item allocator "$<$:-flifetime-dse=1>"