Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Build fails with strict-aliasing violations #1657

Open
eli-schwartz opened this issue Aug 1, 2024 · 1 comment
Open

Build fails with strict-aliasing violations #1657

eli-schwartz opened this issue Aug 1, 2024 · 1 comment

Comments

@eli-schwartz
Copy link

I tried to build with the following *FLAGS to optimize the build: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing

The -Werror=* flags are important to detect cases where the compiler can try to optimize based on assuming Undefined Behavior (UB) cannot happen, and miscompile code that has UB in it. strict-aliasing issues are always bad but LTO can make them even worse.

I got this error:

[1/51] /usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_reference_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT reference/CMakeFiles/ginkgo_reference.dir/solver/common_gmres_kernels.cpp.o -MF reference/CMakeFiles/ginkgo_reference.dir/solver/common_gmres_kernels.cpp.o.d -o reference/CMakeFiles/ginkgo_reference.dir/solver/common_gmres_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/solver/common_gmres_kernels.cpp
FAILED: reference/CMakeFiles/ginkgo_reference.dir/solver/common_gmres_kernels.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_reference_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT reference/CMakeFiles/ginkgo_reference.dir/solver/common_gmres_kernels.cpp.o -MF reference/CMakeFiles/ginkgo_reference.dir/solver/common_gmres_kernels.cpp.o.d -o reference/CMakeFiles/ginkgo_reference.dir/solver/common_gmres_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/solver/common_gmres_kernels.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres_kernels.hpp:17,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/solver/common_gmres_kernels.cpp:14:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
cc1plus: some warnings being treated as errors
[2/51] /usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_reference_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT reference/CMakeFiles/ginkgo_reference.dir/solver/cb_gmres_kernels.cpp.o -MF reference/CMakeFiles/ginkgo_reference.dir/solver/cb_gmres_kernels.cpp.o.d -o reference/CMakeFiles/ginkgo_reference.dir/solver/cb_gmres_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/solver/cb_gmres_kernels.cpp
FAILED: reference/CMakeFiles/ginkgo_reference.dir/solver/cb_gmres_kernels.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_reference_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT reference/CMakeFiles/ginkgo_reference.dir/solver/cb_gmres_kernels.cpp.o -MF reference/CMakeFiles/ginkgo_reference.dir/solver/cb_gmres_kernels.cpp.o.d -o reference/CMakeFiles/ginkgo_reference.dir/solver/cb_gmres_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/solver/cb_gmres_kernels.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres_kernels.hpp:17,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/solver/cb_gmres_kernels.cpp:5:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
cc1plus: some warnings being treated as errors
[3/51] /usr/bin/x86_64-pc-linux-gnu-g++ -DGKO_COMPILING_OMP -DGKO_DEVICE_NAMESPACE=omp -Dginkgo_omp_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -fopenmp -MD -MT omp/CMakeFiles/ginkgo_omp.dir/__/common/unified/solver/common_gmres_kernels.cpp.o -MF omp/CMakeFiles/ginkgo_omp.dir/__/common/unified/solver/common_gmres_kernels.cpp.o.d -o omp/CMakeFiles/ginkgo_omp.dir/__/common/unified/solver/common_gmres_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/common/unified/solver/common_gmres_kernels.cpp
FAILED: omp/CMakeFiles/ginkgo_omp.dir/__/common/unified/solver/common_gmres_kernels.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DGKO_COMPILING_OMP -DGKO_DEVICE_NAMESPACE=omp -Dginkgo_omp_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -fopenmp -MD -MT omp/CMakeFiles/ginkgo_omp.dir/__/common/unified/solver/common_gmres_kernels.cpp.o -MF omp/CMakeFiles/ginkgo_omp.dir/__/common/unified/solver/common_gmres_kernels.cpp.o.d -o omp/CMakeFiles/ginkgo_omp.dir/__/common/unified/solver/common_gmres_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/common/unified/solver/common_gmres_kernels.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres_kernels.hpp:17,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/common/unified/solver/common_gmres_kernels.cpp:10:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
cc1plus: some warnings being treated as errors
[4/51] /usr/bin/x86_64-pc-linux-gnu-g++ -DGKO_COMPILING_OMP -DGKO_DEVICE_NAMESPACE=omp -Dginkgo_omp_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -fopenmp -MD -MT omp/CMakeFiles/ginkgo_omp.dir/preconditioner/jacobi_kernels.cpp.o -MF omp/CMakeFiles/ginkgo_omp.dir/preconditioner/jacobi_kernels.cpp.o.d -o omp/CMakeFiles/ginkgo_omp.dir/preconditioner/jacobi_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp
FAILED: omp/CMakeFiles/ginkgo_omp.dir/preconditioner/jacobi_kernels.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DGKO_COMPILING_OMP -DGKO_DEVICE_NAMESPACE=omp -Dginkgo_omp_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -fopenmp -MD -MT omp/CMakeFiles/ginkgo_omp.dir/preconditioner/jacobi_kernels.cpp.o -MF omp/CMakeFiles/ginkgo_omp.dir/preconditioner/jacobi_kernels.cpp.o.d -o omp/CMakeFiles/ginkgo_omp.dir/preconditioner/jacobi_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:21:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In instantiation of ‘gko::truncated<FloatType, NumComponents, ComponentId>::operator float_type() const [with FloatType = float; long unsigned int NumComponents = 2; long unsigned int ComponentId = 0; float_type = float]’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include/ginkgo/core/base/math.hpp:597:49:   required from ‘R gko::default_converter<S, R>::operator()(S) [with S = gko::truncated<float, 2, 0>; R = float]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:473:38:   required from ‘void gko::kernels::omp::jacobi::{anonymous}::apply_block(gko::size_type, gko::size_type, const BlockValueType*, gko::size_type, ValueType, const ValueType*, gko::size_type, ValueType, ValueType*, gko::size_type, ValueConverter) [with ValueType = float; BlockValueType = gko::truncated<float, 2, 0>; ValueConverter = gko::default_converter<gko::truncated<float, 2, 0>, float>; gko::size_type = long unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:506:9:   required from ‘void gko::kernels::omp::jacobi::apply(std::shared_ptr<const gko::OmpExecutor>, gko::size_type, gko::uint32, const gko::preconditioner::block_interleaved_storage_scheme<IndexType>&, const gko::array<gko::precision_reduction>&, const gko::array<IndexType>&, const gko::array<ValueType>&, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, gko::matrix::Dense<ValueType>*) [with ValueType = float; IndexType = int; gko::size_type = long unsigned int; gko::uint32 = unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:517:1:   required from here
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:437:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  437 |         return reinterpret_cast<const float_type&>(bits);
      |                                                    ^~~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In instantiation of ‘gko::truncated<FloatType, NumComponents, ComponentId>::operator float_type() const [with FloatType = double; long unsigned int NumComponents = 2; long unsigned int ComponentId = 0; float_type = double]’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include/ginkgo/core/base/math.hpp:597:49:   required from ‘R gko::default_converter<S, R>::operator()(S) [with S = gko::truncated<double, 2, 0>; R = double]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:473:38:   required from ‘void gko::kernels::omp::jacobi::{anonymous}::apply_block(gko::size_type, gko::size_type, const BlockValueType*, gko::size_type, ValueType, const ValueType*, gko::size_type, ValueType, ValueType*, gko::size_type, ValueConverter) [with ValueType = double; BlockValueType = gko::truncated<double, 2, 0>; ValueConverter = gko::default_converter<gko::truncated<double, 2, 0>, double>; gko::size_type = long unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:506:9:   required from ‘void gko::kernels::omp::jacobi::apply(std::shared_ptr<const gko::OmpExecutor>, gko::size_type, gko::uint32, const gko::preconditioner::block_interleaved_storage_scheme<IndexType>&, const gko::array<gko::precision_reduction>&, const gko::array<IndexType>&, const gko::array<ValueType>&, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, gko::matrix::Dense<ValueType>*) [with ValueType = double; IndexType = int; gko::size_type = long unsigned int; gko::uint32 = unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:517:1:   required from here
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:437:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In instantiation of ‘gko::truncated<FloatType, NumComponents, ComponentId>::operator float_type() const [with FloatType = double; long unsigned int NumComponents = 4; long unsigned int ComponentId = 0; float_type = double]’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include/ginkgo/core/base/math.hpp:597:49:   required from ‘R gko::default_converter<S, R>::operator()(S) [with S = gko::truncated<double, 4, 0>; R = double]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:473:38:   required from ‘void gko::kernels::omp::jacobi::{anonymous}::apply_block(gko::size_type, gko::size_type, const BlockValueType*, gko::size_type, ValueType, const ValueType*, gko::size_type, ValueType, ValueType*, gko::size_type, ValueConverter) [with ValueType = double; BlockValueType = gko::truncated<double, 4, 0>; ValueConverter = gko::default_converter<gko::truncated<double, 4, 0>, double>; gko::size_type = long unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:506:9:   required from ‘void gko::kernels::omp::jacobi::apply(std::shared_ptr<const gko::OmpExecutor>, gko::size_type, gko::uint32, const gko::preconditioner::block_interleaved_storage_scheme<IndexType>&, const gko::array<gko::precision_reduction>&, const gko::array<IndexType>&, const gko::array<ValueType>&, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, gko::matrix::Dense<ValueType>*) [with ValueType = double; IndexType = int; gko::size_type = long unsigned int; gko::uint32 = unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/preconditioner/jacobi_kernels.cpp:517:1:   required from here
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:437:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
cc1plus: some warnings being treated as errors
[5/51] /usr/bin/x86_64-pc-linux-gnu-g++ -DGKO_COMPILING_OMP -DGKO_DEVICE_NAMESPACE=omp -Dginkgo_omp_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -fopenmp -MD -MT omp/CMakeFiles/ginkgo_omp.dir/solver/cb_gmres_kernels.cpp.o -MF omp/CMakeFiles/ginkgo_omp.dir/solver/cb_gmres_kernels.cpp.o.d -o omp/CMakeFiles/ginkgo_omp.dir/solver/cb_gmres_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/solver/cb_gmres_kernels.cpp
FAILED: omp/CMakeFiles/ginkgo_omp.dir/solver/cb_gmres_kernels.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DGKO_COMPILING_OMP -DGKO_DEVICE_NAMESPACE=omp -Dginkgo_omp_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -fopenmp -MD -MT omp/CMakeFiles/ginkgo_omp.dir/solver/cb_gmres_kernels.cpp.o -MF omp/CMakeFiles/ginkgo_omp.dir/solver/cb_gmres_kernels.cpp.o.d -o omp/CMakeFiles/ginkgo_omp.dir/solver/cb_gmres_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/solver/cb_gmres_kernels.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres_kernels.hpp:17,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/omp/solver/cb_gmres_kernels.cpp:5:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
cc1plus: some warnings being treated as errors
[6/51] /usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_reference_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT reference/CMakeFiles/ginkgo_reference.dir/preconditioner/jacobi_kernels.cpp.o -MF reference/CMakeFiles/ginkgo_reference.dir/preconditioner/jacobi_kernels.cpp.o.d -o reference/CMakeFiles/ginkgo_reference.dir/preconditioner/jacobi_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp
FAILED: reference/CMakeFiles/ginkgo_reference.dir/preconditioner/jacobi_kernels.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_reference_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT reference/CMakeFiles/ginkgo_reference.dir/preconditioner/jacobi_kernels.cpp.o -MF reference/CMakeFiles/ginkgo_reference.dir/preconditioner/jacobi_kernels.cpp.o.d -o reference/CMakeFiles/ginkgo_reference.dir/preconditioner/jacobi_kernels.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:18:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In instantiation of ‘gko::truncated<FloatType, NumComponents, ComponentId>::operator float_type() const [with FloatType = float; long unsigned int NumComponents = 2; long unsigned int ComponentId = 0; float_type = float]’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include/ginkgo/core/base/math.hpp:597:49:   required from ‘R gko::default_converter<S, R>::operator()(S) [with S = gko::truncated<float, 2, 0>; R = float]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:443:38:   required from ‘void gko::kernels::reference::jacobi::{anonymous}::apply_block(gko::size_type, gko::size_type, const BlockValueType*, gko::size_type, ValueType, const ValueType*, gko::size_type, ValueType, ValueType*, gko::size_type, ValueConverter) [with ValueType = float; BlockValueType = gko::truncated<float, 2, 0>; ValueConverter = gko::default_converter<gko::truncated<float, 2, 0>, float>; gko::size_type = long unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:486:9:   required from ‘void gko::kernels::reference::jacobi::apply(std::shared_ptr<const gko::ReferenceExecutor>, gko::size_type, gko::uint32, const gko::preconditioner::block_interleaved_storage_scheme<IndexType>&, const gko::array<gko::precision_reduction>&, const gko::array<IndexType>&, const gko::array<ValueType>&, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, gko::matrix::Dense<ValueType>*) [with ValueType = float; IndexType = int; gko::size_type = long unsigned int; gko::uint32 = unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:497:1:   required from here
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:437:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  437 |         return reinterpret_cast<const float_type&>(bits);
      |                                                    ^~~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In instantiation of ‘gko::truncated<FloatType, NumComponents, ComponentId>::operator float_type() const [with FloatType = double; long unsigned int NumComponents = 2; long unsigned int ComponentId = 0; float_type = double]’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include/ginkgo/core/base/math.hpp:597:49:   required from ‘R gko::default_converter<S, R>::operator()(S) [with S = gko::truncated<double, 2, 0>; R = double]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:443:38:   required from ‘void gko::kernels::reference::jacobi::{anonymous}::apply_block(gko::size_type, gko::size_type, const BlockValueType*, gko::size_type, ValueType, const ValueType*, gko::size_type, ValueType, ValueType*, gko::size_type, ValueConverter) [with ValueType = double; BlockValueType = gko::truncated<double, 2, 0>; ValueConverter = gko::default_converter<gko::truncated<double, 2, 0>, double>; gko::size_type = long unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:486:9:   required from ‘void gko::kernels::reference::jacobi::apply(std::shared_ptr<const gko::ReferenceExecutor>, gko::size_type, gko::uint32, const gko::preconditioner::block_interleaved_storage_scheme<IndexType>&, const gko::array<gko::precision_reduction>&, const gko::array<IndexType>&, const gko::array<ValueType>&, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, gko::matrix::Dense<ValueType>*) [with ValueType = double; IndexType = int; gko::size_type = long unsigned int; gko::uint32 = unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:497:1:   required from here
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:437:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In instantiation of ‘gko::truncated<FloatType, NumComponents, ComponentId>::operator float_type() const [with FloatType = double; long unsigned int NumComponents = 4; long unsigned int ComponentId = 0; float_type = double]’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include/ginkgo/core/base/math.hpp:597:49:   required from ‘R gko::default_converter<S, R>::operator()(S) [with S = gko::truncated<double, 4, 0>; R = double]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:443:38:   required from ‘void gko::kernels::reference::jacobi::{anonymous}::apply_block(gko::size_type, gko::size_type, const BlockValueType*, gko::size_type, ValueType, const ValueType*, gko::size_type, ValueType, ValueType*, gko::size_type, ValueConverter) [with ValueType = double; BlockValueType = gko::truncated<double, 4, 0>; ValueConverter = gko::default_converter<gko::truncated<double, 4, 0>, double>; gko::size_type = long unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:486:9:   required from ‘void gko::kernels::reference::jacobi::apply(std::shared_ptr<const gko::ReferenceExecutor>, gko::size_type, gko::uint32, const gko::preconditioner::block_interleaved_storage_scheme<IndexType>&, const gko::array<gko::precision_reduction>&, const gko::array<IndexType>&, const gko::array<ValueType>&, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, const gko::matrix::Dense<ValueType>*, gko::matrix::Dense<ValueType>*) [with ValueType = double; IndexType = int; gko::size_type = long unsigned int; gko::uint32 = unsigned int]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/reference/preconditioner/jacobi_kernels.cpp:497:1:   required from here
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:437:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
cc1plus: some warnings being treated as errors
[7/51] /usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_dpcpp_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/device_hooks/CMakeFiles/ginkgo_dpcpp.dir/dpcpp_hooks.cpp.o -MF core/device_hooks/CMakeFiles/ginkgo_dpcpp.dir/dpcpp_hooks.cpp.o.d -o core/device_hooks/CMakeFiles/ginkgo_dpcpp.dir/dpcpp_hooks.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/dpcpp_hooks.cpp
FAILED: core/device_hooks/CMakeFiles/ginkgo_dpcpp.dir/dpcpp_hooks.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_dpcpp_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/device_hooks/CMakeFiles/ginkgo_dpcpp.dir/dpcpp_hooks.cpp.o -MF core/device_hooks/CMakeFiles/ginkgo_dpcpp.dir/dpcpp_hooks.cpp.o.d -o core/device_hooks/CMakeFiles/ginkgo_dpcpp.dir/dpcpp_hooks.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/dpcpp_hooks.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres_kernels.hpp:17,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/common_kernels.inc.cpp:56,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/dpcpp_hooks.cpp:156:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
cc1plus: some warnings being treated as errors
[8/51] /usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_cuda_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/device_hooks/CMakeFiles/ginkgo_cuda.dir/cuda_hooks.cpp.o -MF core/device_hooks/CMakeFiles/ginkgo_cuda.dir/cuda_hooks.cpp.o.d -o core/device_hooks/CMakeFiles/ginkgo_cuda.dir/cuda_hooks.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/cuda_hooks.cpp
FAILED: core/device_hooks/CMakeFiles/ginkgo_cuda.dir/cuda_hooks.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_cuda_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/device_hooks/CMakeFiles/ginkgo_cuda.dir/cuda_hooks.cpp.o -MF core/device_hooks/CMakeFiles/ginkgo_cuda.dir/cuda_hooks.cpp.o.d -o core/device_hooks/CMakeFiles/ginkgo_cuda.dir/cuda_hooks.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/cuda_hooks.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres_kernels.hpp:17,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/common_kernels.inc.cpp:56,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/cuda_hooks.cpp:263:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
cc1plus: some warnings being treated as errors
[9/51] /usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_hip_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/device_hooks/CMakeFiles/ginkgo_hip.dir/hip_hooks.cpp.o -MF core/device_hooks/CMakeFiles/ginkgo_hip.dir/hip_hooks.cpp.o.d -o core/device_hooks/CMakeFiles/ginkgo_hip.dir/hip_hooks.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/hip_hooks.cpp
FAILED: core/device_hooks/CMakeFiles/ginkgo_hip.dir/hip_hooks.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_hip_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/device_hooks/CMakeFiles/ginkgo_hip.dir/hip_hooks.cpp.o -MF core/device_hooks/CMakeFiles/ginkgo_hip.dir/hip_hooks.cpp.o.d -o core/device_hooks/CMakeFiles/ginkgo_hip.dir/hip_hooks.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/hip_hooks.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres_kernels.hpp:17,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/common_kernels.inc.cpp:56,
                 from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/device_hooks/hip_hooks.cpp:258:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
cc1plus: some warnings being treated as errors
[10/51] /usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/CMakeFiles/ginkgo.dir/solver/cb_gmres.cpp.o -MF core/CMakeFiles/ginkgo.dir/solver/cb_gmres.cpp.o.d -o core/CMakeFiles/ginkgo.dir/solver/cb_gmres.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres.cpp
FAILED: core/CMakeFiles/ginkgo.dir/solver/cb_gmres.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/CMakeFiles/ginkgo.dir/solver/cb_gmres.cpp.o -MF core/CMakeFiles/ginkgo.dir/solver/cb_gmres.cpp.o.d -o core/CMakeFiles/ginkgo.dir/solver/cb_gmres.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/solver/cb_gmres.cpp:19:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
cc1plus: some warnings being treated as errors
[11/51] /usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/CMakeFiles/ginkgo.dir/preconditioner/jacobi.cpp.o -MF core/CMakeFiles/ginkgo.dir/preconditioner/jacobi.cpp.o.d -o core/CMakeFiles/ginkgo.dir/preconditioner/jacobi.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/preconditioner/jacobi.cpp
FAILED: core/CMakeFiles/ginkgo.dir/preconditioner/jacobi.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -Dginkgo_EXPORTS -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999_build/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/include -I/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999  -pipe -march=native -fstack-protector-all -O2 -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -fPIC -MD -MT core/CMakeFiles/ginkgo.dir/preconditioner/jacobi.cpp.o -MF core/CMakeFiles/ginkgo.dir/preconditioner/jacobi.cpp.o.d -o core/CMakeFiles/ginkgo.dir/preconditioner/jacobi.cpp.o -c /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/preconditioner/jacobi.cpp
In file included from /var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/preconditioner/jacobi.cpp:20:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In constructor ‘gko::half::half(gko::float32)’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:291:60: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  291 |         data_ = float2half(reinterpret_cast<const uint32&>(val));
      |                                                            ^~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In member function ‘gko::half::operator gko::float32() const’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:304:49: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  304 |         return reinterpret_cast<const float32&>(bits);
      |                                                 ^~~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In instantiation of ‘gko::truncated<FloatType, NumComponents, ComponentId>::operator float_type() const [with FloatType = float; long unsigned int NumComponents = 2; long unsigned int ComponentId = 0; float_type = float]’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/preconditioner/jacobi.cpp:236:13:   required from ‘void gko::preconditioner::Jacobi<ValueType, IndexType>::write(mat_data&) const [with ValueType = float; IndexType = int; mat_data = gko::matrix_data<float, int>]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/preconditioner/jacobi.cpp:377:1:   required from here
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:437:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  437 |         return reinterpret_cast<const float_type&>(bits);
      |                                                    ^~~~
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In instantiation of ‘gko::truncated<FloatType, NumComponents, ComponentId>::operator float_type() const [with FloatType = double; long unsigned int NumComponents = 2; long unsigned int ComponentId = 0; float_type = double]’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/preconditioner/jacobi.cpp:236:13:   required from ‘void gko::preconditioner::Jacobi<ValueType, IndexType>::write(mat_data&) const [with ValueType = double; IndexType = int; mat_data = gko::matrix_data<double, int>]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/preconditioner/jacobi.cpp:377:1:   required from here
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:437:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp: In instantiation of ‘gko::truncated<FloatType, NumComponents, ComponentId>::operator float_type() const [with FloatType = double; long unsigned int NumComponents = 4; long unsigned int ComponentId = 0; float_type = double]’:
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/preconditioner/jacobi.cpp:236:13:   required from ‘void gko::preconditioner::Jacobi<ValueType, IndexType>::write(mat_data&) const [with ValueType = double; IndexType = int; mat_data = gko::matrix_data<double, int>]’
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/preconditioner/jacobi.cpp:377:1:   required from here
/var/tmp/portage/sci-libs/ginkgo-9999/work/ginkgo-9999/core/base/extended_float.hpp:437:52: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
cc1plus: some warnings being treated as errors
ninja: build stopped: cannot make progress due to previous errors.

Originally reported downstream: https://bugs.gentoo.org/862705
Full build log: build.log

@yhmtsai
Copy link
Member

yhmtsai commented Oct 23, 2024

@eli-schwartz Thanks for reporting this issue.
We have replaced reinterpret_cast by std::memcpy in #1706 , whose branch is half_type
Could you try it out to check whether it solves this issue?

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

No branches or pull requests

2 participants