]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Improve warning suppression for inlined functions.
authorMartin Sebor <msebor@redhat.com>
Tue, 6 Jul 2021 19:45:54 +0000 (13:45 -0600)
committerMartin Sebor <msebor@redhat.com>
Tue, 6 Jul 2021 19:45:54 +0000 (13:45 -0600)
gcc/ChangeLog:

* config/aarch64/aarch64-builtins.c (aarch64_simd_expand_builtin):
Remove %K and use error_at.
(aarch64_expand_fcmla_builtin): Same.
(aarch64_expand_builtin_tme): Same.
(aarch64_expand_builtin_memtag): Same.
* config/arm/arm-builtins.c (arm_expand_acle_builtin): Same.
(arm_expand_builtin): Same.
* config/arm/arm.c (bounds_check): Same.

gcc/config/aarch64/aarch64-builtins.c
gcc/config/arm/arm-builtins.c
gcc/config/arm/arm.c

index 3cab3ec992c776f03fcbdd1214dd961fb1c9eaba..9ed4b72d005799b8984a858f96d4763e7fa5aa39 100644 (file)
@@ -1598,8 +1598,9 @@ constant_arg:
              if (!(*insn_data[icode].operand[opc].predicate)
                  (op[opc], mode))
              {
-               error ("%Kargument %d must be a constant immediate",
-                      exp, opc + 1 - have_retval);
+               error_at (EXPR_LOCATION (exp),
+                         "argument %d must be a constant immediate",
+                         opc + 1 - have_retval);
                return const0_rtx;
              }
              break;
@@ -1669,10 +1670,13 @@ aarch64_simd_expand_builtin (int fcode, tree exp, rtx target)
                                       / UINTVAL (elementsize),
                                      exp);
           else
-           error ("%Klane index must be a constant immediate", exp);
+           error_at (EXPR_LOCATION (exp),
+                     "lane index must be a constant immediate");
        }
       else
-       error ("%Ktotal size and element size must be a non-zero constant immediate", exp);
+       error_at (EXPR_LOCATION (exp),
+                 "total size and element size must be a non-zero "
+                 "constant immediate");
       /* Don't generate any RTL.  */
       return const0_rtx;
     }
@@ -1828,7 +1832,8 @@ aarch64_expand_fcmla_builtin (tree exp, rtx target, int fcode)
   /* Validate that the lane index is a constant.  */
   if (!CONST_INT_P (lane_idx))
     {
-      error ("%Kargument %d must be a constant immediate", exp, 4);
+      error_at (EXPR_LOCATION (exp),
+               "argument %d must be a constant immediate", 4);
       return const0_rtx;
     }
 
@@ -1917,7 +1922,8 @@ aarch64_expand_builtin_tme (int fcode, tree exp, rtx target)
          emit_insn (GEN_FCN (CODE_FOR_tcancel) (op0));
        else
          {
-           error ("%Kargument must be a 16-bit constant immediate", exp);
+           error_at (EXPR_LOCATION (exp),
+                     "argument must be a 16-bit constant immediate");
            return const0_rtx;
          }
       }
@@ -2006,8 +2012,9 @@ aarch64_expand_builtin_memtag (int fcode, tree exp, rtx target)
                  pat = GEN_FCN (icode) (target, op0, const0_rtx, op1);
                  break;
                }
-             error ("%Kargument %d must be a constant immediate "
-                    "in range [0,15]", exp, 2);
+             error_at (EXPR_LOCATION (exp),
+                       "argument %d must be a constant immediate "
+                       "in range [0,15]", 2);
              return const0_rtx;
            }
          else
index fa0fb0b16ab68f4c126d2e38b79db70d73e83d2a..3a9ff8f26b8e222c52cb70f7509b714c3e475758 100644 (file)
@@ -3092,26 +3092,30 @@ constant_arg:
                          unsigned int cp_bit = (CONST_INT_P (op[argc])
                                                 ? UINTVAL (op[argc]) : -1);
                          if (IN_RANGE (cp_bit, 0, ARM_CDE_CONST_COPROC))
-                           error ("%Kcoprocessor %d is not enabled "
-                                  "with +cdecp%d", exp, cp_bit, cp_bit);
+                           error_at (EXPR_LOCATION (exp),
+                                     "coprocessor %d is not enabled "
+                                     "with +cdecp%d", cp_bit, cp_bit);
                          else
-                           error ("%Kcoproc must be a constant immediate in "
-                                  "range [0-%d] enabled with +cdecp<N>", exp,
-                                  ARM_CDE_CONST_COPROC);
+                           error_at (EXPR_LOCATION (exp),
+                                     "coproc must be a constant immediate in "
+                                     "range [0-%d] enabled with +cdecp<N>",
+                                     ARM_CDE_CONST_COPROC);
                        }
                      else
                        /* Here we mention the builtin name to follow the same
                           format that the C/C++ frontends use for referencing
                           a given argument index.  */
-                       error ("%Kargument %d to %qE must be a constant immediate "
-                              "in range [0-%d]", exp, argc + 1,
+                       error_at (EXPR_LOCATION (exp),
+                                 "argument %d to %qE must be a constant "
+                                 "immediate in range [0-%d]", argc + 1,
                               arm_builtin_decls[fcode],
                               cde_builtin_data[fcode -
                               ARM_BUILTIN_CDE_PATTERN_START].imm_max);
                    }
                  else
-                   error ("%Kargument %d must be a constant immediate",
-                          exp, argc + 1);
+                   error_at (EXPR_LOCATION (exp),
+                             "argument %d must be a constant immediate",
+                             argc + 1);
                  /* We have failed to expand the pattern, and are safely
                     in to invalid code.  But the mid-end will still try to
                     build an assignment for this node while it expands,
@@ -3328,11 +3332,13 @@ arm_expand_acle_builtin (int fcode, tree exp, rtx target)
       if (CONST_INT_P (sat_imm))
        {
          if (!IN_RANGE (sat_imm, min_sat, max_sat))
-           error ("%Ksaturation bit range must be in the range [%wd, %wd]",
-                  exp, UINTVAL (min_sat), UINTVAL (max_sat));
+           error_at (EXPR_LOCATION (exp),
+                     "saturation bit range must be in the range [%wd, %wd]",
+                     UINTVAL (min_sat), UINTVAL (max_sat));
        }
       else
-       error ("%Ksaturation bit range must be a constant immediate", exp);
+       error_at (EXPR_LOCATION (exp),
+                 "saturation bit range must be a constant immediate");
       /* Don't generate any RTL.  */
       return const0_rtx;
     }
@@ -3455,7 +3461,8 @@ arm_expand_builtin (tree exp,
       if (CONST_INT_P (lane_idx))
        neon_lane_bounds (lane_idx, 0, TREE_INT_CST_LOW (nlanes), exp);
       else
-       error ("%Klane index must be a constant immediate", exp);
+       error_at (EXPR_LOCATION (exp),
+                 "lane index must be a constant immediate");
       /* Don't generate any RTL.  */
       return const0_rtx;
     }
index 7b37e1b602c76f731b5d4ede07c5ffc0a2cab121..de37c903450949d2e0faed59498a512c9f187389 100644 (file)
@@ -13244,8 +13244,8 @@ bounds_check (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high,
   if (lane < low || lane >= high)
     {
       if (exp)
-       error ("%K%s %wd out of range %wd - %wd",
-              exp, desc, lane, low, high - 1);
+       error_at (EXPR_LOCATION (exp),
+                 "%s %wd out of range %wd - %wd", desc, lane, low, high - 1);
       else
        error ("%s %wd out of range %wd - %wd", desc, lane, low, high - 1);
     }