On Thu, Feb 19, 2026 at 2:13 PM oltolm <[email protected]> wrote:
>
> In Clang the argument is const, therefore you need to use
> const_cast<void*> to call _m_prefetchw.

https://learn.microsoft.com/en-us/cpp/intrinsics/x86-intrinsics-list?view=msvc-170
Hmm, GCC matches Microsoft's documentation but does not match
Microsoft's definition.
See https://github.com/llvm/llvm-project/issues/48468 where LLVM
changed it to `volatile const` rather than just const.
So you patch should be changing it to `volatile const void*`.
Also even though this patch is small, it would be better if you either
have a copyright assignment or agree with a DCO.
See https://gcc.gnu.org/contribute.html#legal .

Also next time please add a changelog to your commit message as
mentioned on https://gcc.gnu.org/contribute.html.
A testcase or two would be a good idea or maybe there is a testcase
that needed to be changed.
And also mention how you tested this patch.

Thanks,
Andrew

> ---
>  gcc/config/i386/prfchwintrin.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/config/i386/prfchwintrin.h b/gcc/config/i386/prfchwintrin.h
> index af3bded18e..bf2ccf37fc 100644
> --- a/gcc/config/i386/prfchwintrin.h
> +++ b/gcc/config/i386/prfchwintrin.h
> @@ -29,7 +29,7 @@
>  #define _PRFCHWINTRIN_H_INCLUDED
>
>  extern __inline void __attribute__((__gnu_inline__, __always_inline__, 
> __artificial__))
> -_m_prefetchw (void *__P)
> +_m_prefetchw (const void *__P)
>  {
>    __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */);
>  }
> --
> 2.53.0.windows.1
>

Reply via email to