[PATCH] D48069: [cmake] Disable a GCC optimization when building LLVM for MIPS

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 27 02:28:35 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL359376: [cmake] Disable a GCC optimization when building LLVM for MIPS (authored by atanasyan, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D48069?vs=150915&id=196956#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D48069/new/

https://reviews.llvm.org/D48069

Files:
  llvm/trunk/cmake/modules/HandleLLVMOptions.cmake


Index: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
@@ -248,6 +248,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 AND NOT (${CMAKE_SYSTEM_NAME} MATCHES "AIX" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48069.196956.patch
Type: text/x-patch
Size: 707 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190427/7cd264d6/attachment.bin>


More information about the llvm-commits mailing list