diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 34d0475..99e8734 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -6528,33 +6528,26 @@ aarch64_simd_vect_par_cnst_half (enum machine_mode mode, bool high)
   return t1;
 }
 
-/* Ensure OPERAND lies between LOW (inclusive) and HIGH (exclusive).  Raise
-   ERR if it doesn't.  */
-static void
-bounds_check (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high,
-	      const char *err)
+/* Bounds-check lanes.  Ensure OPERAND lies between LOW (inclusive) and
+   HIGH (exclusive).  */
+void
+aarch64_simd_lane_bounds (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high)
 {
-  HOST_WIDE_INT lane;
-
   gcc_assert (GET_CODE (operand) == CONST_INT);
-
-  lane = INTVAL (operand);
+  HOST_WIDE_INT lane = INTVAL (operand);
 
   if (lane < low || lane >= high)
-    error ("%s", err);
-}
-
-/* Bounds-check lanes.  */
-void
-aarch64_simd_lane_bounds (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high)
-{
-  bounds_check (operand, low, high, "lane out of range");
+    error ("lane out of range");
 }
 
 void
 aarch64_simd_const_bounds (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high)
 {
-  bounds_check (operand, low, high, "constant out of range");
+  gcc_assert (GET_CODE (operand) == CONST_INT);
+  HOST_WIDE_INT lane = INTVAL (operand);
+
+  if (lane < low || lane >= high)
+    error ("constant out of range");
 }
 
 /* Emit code to reinterpret one Neon type as another, without altering bits.  */
