[Boost-bugs] [Boost C++ Libraries] #8695: boost::polygon faillure with optimizations enabled on g++-4.7.2

Subject: [Boost-bugs] [Boost C++ Libraries] #8695: boost::polygon faillure with optimizations enabled on g++-4.7.2
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-06-13 17:39:44


#8695: boost::polygon faillure with optimizations enabled on g++-4.7.2
------------------------------+----------------------
 Reporter: hodevel@… | Owner: ljsimons
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: polygon
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: |
------------------------------+----------------------
 Following program does not return same results depending on optimization
 level.
 When using -00 with g++-4.7.2, area is 100 (good result).
 When using -02, area is 0 (bad result).

 Other compilation options:
 -Wall -std=c++0x -g

 {{{
 #include <iostream>
 #include <cstdio>
 #include <boost/polygon/polygon.hpp>


 typedef boost::polygon::point_data<int> point_t;
 typedef boost::polygon::polygon_data<int> poly_t;
 typedef boost::polygon::polygon_set_data<int> poly_set_t;

 int main(int argc, char** argv)
 {
         using namespace boost::polygon::operators;

         std::list<point_t> points =
         {
                 point_t(0, 0),
                 point_t(10, 0),
                 point_t(10, 10),
                 point_t(0, 10)
         };

         poly_t poly;
         poly.set(points.begin(), points.end());

         poly_set_t poly_set;
         poly_set |= poly;

         std::cout << "poly_set area: " << boost::polygon::area(poly_set)
                 << std::endl;

         return 0;
 }

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8695>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC