Skip to content

Commit 92f2d52

Browse files
committed
Prevent FP contractions to FMA in index/detail/algorithms/content.hpp to fix #1452 on GCC with x86-64-v3.
1 parent 0ba089b commit 92f2d52

File tree

1 file changed

+11
-0
lines changed
  • include/boost/geometry/index/detail/algorithms

1 file changed

+11
-0
lines changed

include/boost/geometry/index/detail/algorithms/content.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_CONTENT_HPP
1717
#define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_CONTENT_HPP
1818

19+
#include <boost/config.hpp>
20+
1921
#include <boost/geometry/core/access.hpp>
2022
#include <boost/geometry/core/coordinate_dimension.hpp>
2123
#include <boost/geometry/core/coordinate_type.hpp>
@@ -26,6 +28,11 @@
2628

2729
namespace boost { namespace geometry { namespace index { namespace detail {
2830

31+
#if defined(BOOST_GCC)
32+
#pragma GCC push_options
33+
#pragma GCC optimize ("fp-contract=off")
34+
#endif
35+
2936
template <typename Indexable>
3037
struct default_content_result
3138
{
@@ -98,6 +105,10 @@ typename default_content_result<Indexable>::type content(Indexable const& b)
98105
>::apply(b);
99106
}
100107

108+
#if defined(BOOST_GCC)
109+
#pragma GCC pop_options
110+
#endif
111+
101112
}}}} // namespace boost::geometry::index::detail
102113

103114
#endif // BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_CONTENT_HPP

0 commit comments

Comments
 (0)