Skip to content

[SYCL] workaround for memaccess warning from older hostcompiler #18435

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

cperkinsintel
Copy link
Contributor

Older gcc when used as host compiler may trigger memaccess warning. This simple cast avoids that warning.

…his simple cast avoids that warning.

Signed-off-by: Chris Perkins <chris.perkins@intel.com>
@cperkinsintel cperkinsintel marked this pull request as ready for review May 13, 2025 04:33
@cperkinsintel cperkinsintel requested a review from a team as a code owner May 13, 2025 04:33
@steffenlarsen
Copy link
Contributor

Failed on Arc:
SYCL :: KernelAndProgram/cache_env_vars.cpp
SYCL :: KernelAndProgram/cache_env_vars_lin.cpp
SYCL :: KernelCompiler/opencl.cpp
SYCL :: KernelCompiler/sycl_cache_pm.cpp

Reported in #18416

@steffenlarsen steffenlarsen merged commit b8b385e into intel:sycl May 13, 2025
23 of 24 checks passed
@@ -24,7 +24,7 @@ inline void memcpy_no_adl(T1 *Dst, const T2 *Src, size_t Size) {
#ifdef __SYCL_DEVICE_ONLY__
__builtin_memcpy(Dst, Src, Size);
#else
std::memcpy(Dst, Src, Size);
std::memcpy(static_cast<void *>(Dst), static_cast<const void *>(Src), Size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, this should be done on bit_cast->memcpy_no_adl call, not in memcpy_no_adl->memcpy call.

Also, per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104855 the warning is correct, so I'm not sure why recent GCCs don't emit it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants