GEOS-DEV/LvArray

Strict aliasing error

klevzoff opened this issue · 2 comments

I get this on Ascent with gcc-8.1.1
Is this a legit error or gcc acting weird?

In file included from /autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/cxx-utilities/src/src/ArrayView.hpp:29,
                 from /autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/cxx-utilities/src/src/Array.hpp:30,
                 from /autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/common/DataTypes.hpp:40,
                 from /autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/dataRepository/xmlWrapper.hpp:27,
                 from /autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/dataRepository/Group.hpp:27,
                 from /autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/dataRepository/Group.cpp:15:
/autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/cxx-utilities/src/src/ChaiVector.hpp: In instantiation of 'void LvArray::ChaiVector<T>::move(chai::ExecutionSpace, bool) [with T = std::__cxx11::basic_string<char>]':
/autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/cxx-utilities/src/src/Array.hpp:426:5:   required from 'typename std::enable_if<(! LvArray::detail::is_array<U>::value), void>::type LvArray::Array<T, NDIM, INDEX_TYPE, DATA_VECTOR_TYPE>::move(chai::ExecutionSpace, bool) [with U = std::__cxx11::basic_string<char>; T = std::__cxx11::basic_string<char>; int NDIM = 1; INDEX_TYPE = long int; DATA_VECTOR_TYPE = LvArray::ChaiVector<std::__cxx11::basic_string<char> >; typename std::enable_if<(! LvArray::detail::is_array<U>::value), void>::type = void]'
/autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/dataRepository/Wrapper.hpp:991:7:   required from 'static typename std::enable_if<geosx::dataRepository::Wrapper<U>::move_wrapper::has_memberfunction_move<TT>::value, void>::type geosx::dataRepository::Wrapper<U>::move_wrapper::move(U&, chai::ExecutionSpace, bool) [with U = LvArray::Array<std::__cxx11::basic_string<char>, 1, long int, LvArray::ChaiVector<std::__cxx11::basic_string<char> > >; T = LvArray::Array<std::__cxx11::basic_string<char>, 1, long int, LvArray::ChaiVector<std::__cxx11::basic_string<char> > >; typename std::enable_if<geosx::dataRepository::Wrapper<U>::move_wrapper::has_memberfunction_move<TT>::value, void>::type = void]'
/autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/dataRepository/Wrapper.hpp:1001:30:   required from 'void geosx::dataRepository::Wrapper<U>::move(chai::ExecutionSpace, bool) [with T = LvArray::Array<std::__cxx11::basic_string<char>, 1, long int, LvArray::ChaiVector<std::__cxx11::basic_string<char> > >]'
/autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/dataRepository/Wrapper.hpp:1000:16:   required from here
/autofs/nccsopen-svm1_home/klevtsov/GEOSX/src/coreComponents/cxx-utilities/src/src/ChaiVector.hpp:473:63: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
     else reinterpret_cast< chai::ManagedArray< T const > & >( m_array ).move( space );
                                                               ^~~~~~~

@klevzoff We have a gcc8/cuda10 build "working" on lassen. That should mean that his is resolved?

I don't have access to test it on ascent where it happened, but I'd assume this is no longer a problem since the implementation has changed quite a bit and we're not using chai::ManagedArray anymore.