diff --git a/libavutil/x86/intmath.h b/libavutil/x86/intmath.h
index 85f15a4930291b3c58b0704297df72efe4278bc6..fefad205e630a84944b545ebb1be3f37905c462c 100644
--- a/libavutil/x86/intmath.h
+++ b/libavutil/x86/intmath.h
@@ -41,7 +41,7 @@
 
 #if AV_GCC_VERSION_AT_LEAST(5,1)
 #define av_mod_uintp2 __builtin_ia32_bzhi_si
-#else
+#elif HAVE_INLINE_ASM
 /* GCC releases before 5.1.0 have a broken bzhi builtin, so for those we
  * implement it using inline assembly
  */