aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHaochen Jiang <haochen.jiang@intel.com>2024-11-01 16:42:12 +0800
committerHaochen Jiang <haochen.jiang@intel.com>2024-11-02 02:16:53 +0800
commit79a75b1f551821687e1ce27a82ee39b802ace2b4 (patch)
treef84fe438e21782cf1d0f3d781a5b0d69402e89e1 /gcc
parentc5a36c4e591e41efe3e4d892ff62831d801752d3 (diff)
downloadgcc-79a75b1f551821687e1ce27a82ee39b802ace2b4.zip
gcc-79a75b1f551821687e1ce27a82ee39b802ace2b4.tar.gz
gcc-79a75b1f551821687e1ce27a82ee39b802ace2b4.tar.bz2
Use IN_RANGE in prefetch builtin
These are the last minute changes that should apply to MOVRS patch but disappeared in patch. Using IN_RANGE will avoid second usage of INTVAL for prefetch check. gcc/ChangeLog: * builtins.cc (expand_builtin_prefetch): Use IN_RANGE to avoid second usage of INTVAL.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/builtins.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/builtins.cc b/gcc/builtins.cc
index 504b31f..b868441 100644
--- a/gcc/builtins.cc
+++ b/gcc/builtins.cc
@@ -1297,7 +1297,7 @@ expand_builtin_prefetch (tree exp)
else
op1 = expand_normal (arg1);
/* Argument 1 must be 0, 1 or 2. */
- if (INTVAL (op1) < 0 || INTVAL (op1) > 2)
+ if (IN_RANGE (INTVAL (op1), 0, 2))
{
warning (0, "invalid second argument to %<__builtin_prefetch%>;"
" using zero");
@@ -1315,7 +1315,7 @@ expand_builtin_prefetch (tree exp)
else
op2 = expand_normal (arg2);
/* Argument 2 must be 0, 1, 2, or 3. */
- if (INTVAL (op2) < 0 || INTVAL (op2) > 3)
+ if (IN_RANGE (INTVAL (op2), 0, 3))
{
warning (0, "invalid third argument to %<__builtin_prefetch%>; using zero");
op2 = const0_rtx;