From: Timo Heister Date: Sun, 11 Oct 2020 18:14:53 +0000 (-0400) Subject: work around gcc segfault in tensor.h X-Git-Tag: v9.3.0-rc1~1013^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9267296c277ebe6616ef06165a02d752085d8194;p=dealii.git work around gcc segfault in tensor.h gcc 5.4.0 with -O1 in debug mode segfaults with ``` In file included from ../include/deal.II/base/symmetric_tensor.h:25:0, from ../include/deal.II/base/array_view.h:23, from ../source/fe/fe_values.cc:16, from ../source/fe/fe_values_inst4.cc:17: ../include/deal.II/base/tensor.h: In function ‘void dealii::FEValuesViews::internal::do_function_symmetric_gradients(const dealii::ArrayView&, const dealii::Table<2, dealii::Tensor<1, spacedim> >&, const std::vector::ShapeFunctionData>&, std::vector >::type>&) [with int dim = 1; int spacedim = 1; Number = std::complex; typename dealii::FEValuesViews::Vector::ShapeFunctionData = dealii::FEValuesViews::Vector<1, 1>::ShapeFunctionData; typename dealii::ProductType >::type = dealii::SymmetricTensor<2, 1, std::complex >]’: ../include/deal.II/base/tensor.h:497:35: in constexpr expansion of ‘(long unsigned int)(__first + 16u)()’ ../include/deal.II/base/tensor.h:497:35: in constexpr expansion of ‘()’ ../include/deal.II/base/tensor.h:497:35: in constexpr expansion of ‘dealii::Tensor<2, 1, double>()’ ../include/deal.II/base/tensor.h:497:35: in constexpr expansion of ‘(void*)__first()’ In file included from ../source/fe/fe_values_inst4.cc:17:0: ../source/fe/fe_values.cc:700:5: internal compiler error: Segmentation fault do_function_symmetric_gradients( ``` Work around this by changing the constructor. --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index f7a0797c94..e13fcac55d 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -495,12 +495,10 @@ public: */ constexpr DEAL_II_ALWAYS_INLINE DEAL_II_CUDA_HOST_DEV Tensor() -#ifdef DEAL_II_MSVC + // We would like to use =default, but this causes compile errors with some + // MSVC versions and internal compiler errors with -O1 in gcc 5.4. : values{} {} -#else - = default; -#endif /** * A constructor where the data is copied from a C-style array.