cmake: sync cutoff version with autotools for picky option -ftree-vrp

Sync cutoff version for `-ftree-vrp` with autotools, which enables it
for gcc 4.3+ (cmake builds enabled it for 5.0+, before this patch).

Cherry-picked from #16476
Closes #16478
This commit is contained in:
Viktor Szakats 2025-02-25 14:54:08 +01:00
parent 29978df61f
commit baa9c647d3
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -182,6 +182,7 @@ if(PICKY_COMPILER)
-Wold-style-declaration # gcc 4.3 -Wold-style-declaration # gcc 4.3
-Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0 -Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
-Wstrict-aliasing=3 # gcc 4.0 -Wstrict-aliasing=3 # gcc 4.0
-ftree-vrp # gcc 4.3 (required for -Warray-bounds, included in -Wall)
) )
endif() endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
@ -204,7 +205,7 @@ if(PICKY_COMPILER)
endif() endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
list(APPEND _picky_enable list(APPEND _picky_enable
-Warray-bounds=2 -ftree-vrp # clang 3.0 gcc 5.0 (clang default: -Warray-bounds) -Warray-bounds=2 # clang 3.0 gcc 5.0 (clang default: -Warray-bounds)
) )
endif() endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0)