diff --git a/sysdeps/loongarch/fpu/math-barriers.h b/sysdeps/loongarch/fpu/math-barriers.h
index 6a069ff41d..76835aa210 100644
--- a/sysdeps/loongarch/fpu/math-barriers.h
+++ b/sysdeps/loongarch/fpu/math-barriers.h
@@ -21,8 +21,8 @@
 
 /* Generic code forces values to memory; we don't need to do that.  */
 #define math_opt_barrier(x)					\
-  ({ __typeof (x) __x = (x); __asm ("" : "+frm" (__x)); __x; })
+  ({ __typeof (x) __x = (x); __asm ("" : "+fm" (__x)); __x; })
 #define math_force_eval(x)						\
-  ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "frm" (__x)); })
+  ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "fm" (__x)); })
 
 #endif /* math-barriers.h */
