llvm.org GIT mirror llvm / 7047808
[cmake] Disable a GCC optimization when building LLVM for MIPS GCC when compiling LLVM for MIPS can introduce a jump to an uninitialized value when shrink wrapping is enabled. As shrink wrapping is enabled in GCC at all optimization levels, it must be disabled. This bug exists for all versions of GCC since 4.9.2. This partially resolves PR37701 / GCC PR target/86069. Patch by Simon Dardis. Differential Revision: https://reviews.llvm.org/D48069 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359376 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Atanasyan 5 months ago
1 changed file(s) with 5 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
246246 # On Windows all code is PIC. MinGW warns if -fPIC is used.
247247 else()
248248 add_flag_or_print_warning("-fPIC" FPIC)
249 endif()
250 # GCC for MIPS can miscompile LLVM due to PR37701.
251 if(CMAKE_COMPILER_IS_GNUCXX AND LLVM_NATIVE_ARCH STREQUAL "Mips" AND
252 NOT Uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
253 add_flag_or_print_warning("-fno-shrink-wrap" FNO_SHRINK_WRAP)
249254 endif()
250255 endif()
251256