clang-18.1.3 on Ubuntu 24.04.2 reports warning:
thread_loop.c:41:23: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
41 | : /* in */ [i] "r" (i), [len] "r" (len)
| ^
thread_loop.c:37:8: note: use constraint modifier "w"
37 | "add %[i], %[i], #1\n"
| ^~~~
| %w[i]
thread_loop.c:41:23: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
41 | : /* in */ [i] "r" (i), [len] "r" (len)
| ^
thread_loop.c:37:14: note: use constraint modifier "w"
37 | "add %[i], %[i], #1\n"
| ^~~~
| %w[i]
thread_loop.c:41:23: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
41 | : /* in */ [i] "r" (i), [len] "r" (len)
| ^
thread_loop.c:38:8: note: use constraint modifier "w"
38 | "cmp %[i], %[len]\n"
| ^~~~
| %w[i]
thread_loop.c:41:38: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
41 | : /* in */ [i] "r" (i), [len] "r" (len)
| ^
thread_loop.c:38:14: note: use constraint modifier "w"
38 | "cmp %[i], %[len]\n"
| ^~~~~~
| %w[len]
Use the modifier "w" for 32-bit register access.
Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20251006-perf_build_android_ndk-v3-6-4305590795b2@arm.com
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: James Clark <james.clark@linaro.org>
Cc: linux-riscv@lists.infradead.org
Cc: llvm@lists.linux.dev
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-perf-users@vger.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>