Index: rustc/vendor/compiler_builtins/compiler-rt/lib/builtins/trunctfdf2.c
===================================================================
--- rustc.orig/vendor/compiler_builtins/compiler-rt/lib/builtins/trunctfdf2.c
+++ rustc/vendor/compiler_builtins/compiler-rt/lib/builtins/trunctfdf2.c
@@ -7,6 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
+#if defined(__aarch64__) && (__GNUC__ <= 4) && (__GNUC_MINOR__ <= 8)
+// work around https://launchpad.net/bugs/1667761
+#pragma GCC push_options
+#pragma GCC optimize "O1"
+#endif
+
 #define QUAD_PRECISION
 #include "fp_lib.h"
 
@@ -20,3 +26,7 @@ COMPILER_RT_ABI double __trunctfdf2(long
 }
 
 #endif
+#if defined(__aarch64__) && (__GNUC__ <= 4) && (__GNUC_MINOR__ <= 8)
+#pragma GCC pop_options
+#endif
+
