--- a/yor_nfft.c
+++ b/yor_nfft.c
@@ -72,6 +72,8 @@
 #endif
 #include <nfft3.h>
 #include <fftw3.h>
+#define __USE_GNU 1
+#include <fenv.h>
 
 /* Deal with different versions of NFFT3. */
 #ifdef NFFT_DEFINE_MALLOC_API
@@ -1063,7 +1065,11 @@
 
   /* Precompute interpolation weights. */
   if ((plan->MEMBER_NFFT_FLAGS & PRE_ONE_PSI) != 0) {
+    // Debian patch: on some architectures, GCC optimizations -O2 and above
+    // lead to nfft_precompute_one_psi() triggering SIGFPE
+    int prevexcepts=fedisableexcept(FE_INVALID);
     nfft_precompute_one_psi(plan);
+    feenableexcept(prevexcepts);
   }
   return;
 
