[PATCH] D48069: [cmake] Disable a GCC optimization when building LLVM for MIPS
Simon Dardis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 12 03:16:39 PDT 2018
sdardis created this revision.
sdardis added a reviewer: beanz.
Herald added subscribers: atanasyan, arichardson, mgorny.
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.
Repository:
rL LLVM
https://reviews.llvm.org/D48069
Files:
cmake/modules/HandleLLVMOptions.cmake
Index: cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -223,6 +223,11 @@
else()
add_flag_or_print_warning("-fPIC" FPIC)
endif()
+ # GCC for MIPS can miscompile LLVM due to PR37701.
+ if(CMAKE_COMPILER_IS_GNUCXX AND LLVM_NATIVE_ARCH STREQUAL "Mips" AND
+ NOT Uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ add_flag_or_print_warning("-fno-shrink-wrap" FNO_SHRINK_WRAP)
+ endif()
endif()
if(NOT WIN32 AND NOT CYGWIN)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48069.150915.patch
Type: text/x-patch
Size: 588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180612/4c086253/attachment.bin>
More information about the llvm-commits
mailing list