cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.09k stars 4.32k forks source link

[CPP20] [Alpaka?] memcpy accessing ... or more bytes at offsets [...] and 1 may overlap up to... bytes at offset -3 [-Wrestrict] #44096

Open iarspider opened 8 months ago

iarspider commented 8 months ago

During compilation of HeterogeneousCore/AlpakaInterface module in CPP20 IBs log, the gcc emits the following warnings:

In static member function 'static constexpr std::char_traits<char>::char_type* std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)',
    inlined from 'static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:431:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.tcc:532:14,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:2179:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:1936:21,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:3549:32,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = true]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:64:24:
  .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/char_traits.h:435:57: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]
   435 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In static member function 'static constexpr std::char_traits<char>::char_type* std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)',
    inlined from 'static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:431:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.tcc:532:14,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:2179:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:1936:21,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:3549:32,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:64:24,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:51:1,
    inlined from 'alpaka::trait::BufAlloc<std::byte, std::integral_constant<long unsigned int, 1>, long unsigned int, alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, void>::allocBuf<long unsigned int>(const alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>&, const long unsigned int&)::<lambda(std::byte*)>' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp:266:374,
    inlined from 'std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter, _Alloc) [with _Ptr = std::byte*; _Deleter = alpaka::trait::BufAlloc<std::byte, std::integral_constant<long unsigned int, 1>, long unsigned int, alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, void>::allocBuf<long unsigned int>(const alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>&, const long unsigned int&)::<lambda(std::byte*)>; _Alloc = std::allocator<void>; <template-parameter-2-4> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/shared_ptr_base.h:958:4,
    inlined from 'std::__shared_count<_Lp>::__shared_count(_Ptr, _Deleter) [with _Ptr = std::byte*; _Deleter = alpaka::trait::BufAlloc<std::byte, std::integral_constant<long unsigned int, 1>, long unsigned int, alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, void>::allocBuf<long unsigned int>(const alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>&, const long unsigned int&)::<lambda(std::byte*)>; <template-parameter-2-3> = void; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/shared_ptr_base.h:938:97,
    inlined from 'std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Yp*, _Deleter) [with _Yp = std::byte; _Deleter = alpaka::trait::BufAlloc<std::byte, std::integral_constant<long unsigned int, 1>, long unsigned int, alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, void>::allocBuf<long unsigned int>(const alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>&, const long unsigned int&)::<lambda(std::byte*)>; <template-parameter-2-3> = void; _Tp = std::byte; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/shared_ptr_base.h:1477:53,
    inlined from 'std::shared_ptr<_Tp>::shared_ptr(_Yp*, _Deleter) [with _Yp = std::byte; _Deleter = alpaka::trait::BufAlloc<std::byte, std::integral_constant<long unsigned int, 1>, long unsigned int, alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, void>::allocBuf<long unsigned int>(const alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>&, const long unsigned int&)::<lambda(std::byte*)>; <template-parameter-2-3> = void; _Tp = std::byte]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/shared_ptr.h:231:77,
    inlined from 'alpaka::BufUniformCudaHipRt<TApi, TElem, TDim, TIdx>::BufUniformCudaHipRt(const alpaka::DevUniformCudaHipRt<TApi>&, TElem*, Deleter, const TExtent&, std::size_t) [with TExtent = long unsigned int; Deleter = alpaka::trait::BufAlloc<std::byte, std::integral_constant<long unsigned int, 1>, long unsigned int, alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, void>::allocBuf<long unsigned int>(const alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>&, const long unsigned int&)::<lambda(std::byte*)>; TApi = alpaka::ApiCudaRt; TElem = std::byte; TDim = std::integral_constant<long unsigned int, 1>; TIdx = long unsigned int]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp:68:106,
    inlined from 'static alpaka::BufUniformCudaHipRt<TApi, TElem, TDim, TIdx> alpaka::trait::BufAlloc<TElem, Dim, TIdx, alpaka::DevUniformCudaHipRt<TApi>, void>::allocBuf(const alpaka::DevUniformCudaHipRt<TApi>&, const TExtent&) [with TExtent = long unsigned int; TApi = alpaka::ApiCudaRt; TElem = std::byte; Dim = std::integral_constant<long unsigned int, 1>; TIdx = long unsigned int]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp:266:631:
  .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/char_traits.h:435:57: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]
   435 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In static member function 'static constexpr std::char_traits<char>::char_type* std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)',
    inlined from 'static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:431:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.tcc:532:14,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:2179:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:1936:21,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:3549:32,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:64:24,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:51:1,
    inlined from 'alpaka::trait::BufAlloc<std::byte, std::integral_constant<long unsigned int, 1>, long unsigned int, alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, void>::allocBuf<long unsigned int>(const alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>&, const long unsigned int&)::<lambda(std::byte*)>' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp:266:374,
    inlined from 'void std::_Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp>::_M_dispose() [with _Ptr = std::byte*; _Deleter = alpaka::trait::BufAlloc<std::byte, std::integral_constant<long unsigned int, 1>, long unsigned int, alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, void>::allocBuf<long unsigned int>(const alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>&, const long unsigned int&)::<lambda(std::byte*)>; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/shared_ptr_base.h:527:21:
  .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/char_traits.h:435:57: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]
   435 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In static member function 'static constexpr std::char_traits<char>::char_type* std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)',
    inlined from 'static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:431:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.tcc:532:14,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:2179:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:1936:21,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:3549:32,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:64:24,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:51:1,
    inlined from 'alpaka::uniform_cuda_hip::detail::EventUniformCudaHipImpl<TApi>::~EventUniformCudaHipImpl() [with TApi = alpaka::ApiCudaRt]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/event/EventUniformCudaHipRt.hpp:66:356,
    inlined from 'constexpr void std::destroy_at(_Tp*) [with _Tp = alpaka::uniform_cuda_hip::detail::EventUniformCudaHipImpl<alpaka::ApiCudaRt>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/stl_construct.h:88:17,
    inlined from 'constexpr void std::_Destroy(_Tp*) [with _Tp = alpaka::uniform_cuda_hip::detail::EventUniformCudaHipImpl<alpaka::ApiCudaRt>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/stl_construct.h:149:16,
    inlined from 'static constexpr void std::allocator_traits<std::allocator<void> >::destroy(allocator_type&, _Up*) [with _Up = alpaka::uniform_cuda_hip::detail::EventUniformCudaHipImpl<alpaka::ApiCudaRt>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/alloc_traits.h:648:16,
    inlined from 'void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_dispose() [with _Tp = alpaka::uniform_cuda_hip::detail::EventUniformCudaHipImpl<alpaka::ApiCudaRt>; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/shared_ptr_base.h:613:36:
  .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/char_traits.h:435:57: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]
   435 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In static member function 'static constexpr std::char_traits<char>::char_type* std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)',
    inlined from 'static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:431:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.tcc:532:14,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:2179:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:1936:21,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:3549:32,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:64:24,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:51:1,
    inlined from 'alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<TApi>::~QueueUniformCudaHipRtImpl() [with TApi = alpaka::ApiCudaRt]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/queue/cuda_hip/QueueUniformCudaHipRt.hpp:74:370,
    inlined from 'constexpr void std::destroy_at(_Tp*) [with _Tp = alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<alpaka::ApiCudaRt>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/stl_construct.h:88:17,
    inlined from 'constexpr void std::_Destroy(_Tp*) [with _Tp = alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<alpaka::ApiCudaRt>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/stl_construct.h:149:16,
    inlined from 'static constexpr void std::allocator_traits<std::allocator<void> >::destroy(allocator_type&, _Up*) [with _Up = alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<alpaka::ApiCudaRt>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/alloc_traits.h:648:16,
    inlined from 'void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_dispose() [with _Tp = alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<alpaka::ApiCudaRt>; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/shared_ptr_base.h:613:36:
  .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/char_traits.h:435:57: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]
   435 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In static member function 'static constexpr std::char_traits<char>::char_type* std::char_traits<char>::copy(char_type*, const char_type*, std::size_t)',
    inlined from 'static constexpr void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_S_copy(_CharT*, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:431:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.tcc:532:14,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::replace(size_type, size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:2179:18,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:1936:21,
    inlined from 'constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/basic_string.h:3549:32,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:64:24,
    inlined from 'void alpaka::uniform_cuda_hip::detail::rtCheckIgnore(const typename TApi::Error_t&, const char*, const char*, const int&, std::initializer_list<typename TApi::Error_t>) [with TApi = alpaka::ApiCudaRt; bool TThrow = false]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/core/UniformCudaHip.hpp:51:1,
    inlined from 'alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<TApi>::~QueueUniformCudaHipRtImpl() [with TApi = alpaka::ApiCudaRt]' at .../alpaka/1.1.0-0e0b978d445f7af747cf00064c146356/include/alpaka/queue/cuda_hip/QueueUniformCudaHipRt.hpp:75:366,
    inlined from 'constexpr void std::destroy_at(_Tp*) [with _Tp = alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<alpaka::ApiCudaRt>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/stl_construct.h:88:17,
    inlined from 'constexpr void std::_Destroy(_Tp*) [with _Tp = alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<alpaka::ApiCudaRt>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/stl_construct.h:149:16,
    inlined from 'static constexpr void std::allocator_traits<std::allocator<void> >::destroy(allocator_type&, _Up*) [with _Up = alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<alpaka::ApiCudaRt>]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/alloc_traits.h:648:16,
    inlined from 'void std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_dispose() [with _Tp = alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRtImpl<alpaka::ApiCudaRt>; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]' at .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/shared_ptr_base.h:613:36:
  .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/char_traits.h:435:57: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]
   435 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
iarspider commented 8 months ago

assign heterogeneous

cmsbuild commented 8 months ago

New categories assigned: heterogeneous

@fwyzard,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks

cmsbuild commented 8 months ago

cms-bot internal usage

cmsbuild commented 8 months ago

A new Issue was created by @iarspider.

@makortel, @smuzaffar, @rappoccio, @sextonkennedy, @antoniovilela, @Dr15Jones can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

fwyzard commented 8 months ago

There seems to be some issue with signed/unsigned sizes and conversions:

  .../gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/include/c++/12.3.1/bits/char_traits.h:435:57: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' accessing 9223372036854775810 or more bytes at offsets [2, 9223372036854775807] and 1 may overlap up to 9223372036854775813 bytes at offset -3 [-Wrestrict]

9223372036854775807 is 0x7FFFFFFFFFFFFFFF, 9223372036854775810 is 0x8000000000000002, 9223372036854775813 is 0x8000000000000005

I don't think we have such large buffers...

fwyzard commented 8 months ago

The line gcc complains about in the first error is

                rtCheck<TApi, TThrow>(error, ("'" + std::string(cmd) + "' returned error ").c_str(), file, line);

What is wrong with it ?

makortel commented 8 months ago

The std function in question is (I added a comment to highlight the line 435)

  template<>
    struct char_traits<char>
    {

    // ...

      static _GLIBCXX20_CONSTEXPR char_type*
      copy(char_type* __s1, const char_type* __s2, size_t __n)
      {
        if (__n == 0)
          return __s1;
#if __cplusplus >= 202002L
        if (std::__is_constant_evaluated())
          return __gnu_cxx::char_traits<char_type>::copy(__s1, __s2, __n);
#endif
        return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n)); // <------ line 435
      }

Given the large numbers, smells like a compiler bug.

chillenzer commented 5 months ago

See https://github.com/alpaka-group/alpaka/pull/2295 should soon be resolved in latest develop branch.

fwyzard commented 5 months ago

The line gcc complains about in the first error is

                rtCheck<TApi, TThrow>(error, ("'" + std::string(cmd) + "' returned error ").c_str(), file, line);

What is wrong with it ?

Looking at it again: is the temporary returned by c_str() guaranteed to be valid in this case ?

fwyzard commented 4 months ago

Answering myself: yes, it should be fine.

makortel commented 2 months ago

(just came across the warnings in a local area) Would it be worth for us to cherry-pick https://github.com/alpaka-group/alpaka/pull/2295? Or we wait for the Alpaka 1.2 and upgrade there in 14_2_X? (although that would leave the warnings in 14_1_X build logs)

fwyzard commented 2 months ago

We can cherry pick it, I think we are already using a dedicated branch anyway.

fwyzard commented 2 months ago

https://github.com/cms-sw/cmsdist/pull/9376