Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12330: boost::thread starts with invalid FPU control word value in Embarcadero C++ Builder
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-09-05 07:55:16
#12330: boost::thread starts with invalid FPU control word value in Embarcadero C++
Builder
-------------------------------------------------+-------------------------
Reporter: Ville-Valtteri Tiittanen <ville- | Owner: viboes
valtteri.tiittanen@â¦> | Status: assigned
Type: Support Requests | Component: thread
Milestone: To Be Determined | Severity: Regression
Version: Boost 1.55.0 | Keywords:
Resolution: |
-------------------------------------------------+-------------------------
Comment (by Ville-Valtteri Tiittanen <ville-valtteri.tiittanen@â¦>):
What need do you mean?
- C++ standard specifies that floating point control word should be
inherited from the parent thread.
- Source code in the bug report is a full program
- I have tested this with Boost 1.55.0, using Embarcadero C++ Builder
10.1.
- I am using bcc32c, which is the new compiler for this version. To run
the program with bcc32c compiler, you need to compile for 32-bit target
and uncheck "Project -> Options -> C++ Compiler -> Use 'classic' Borland
compiler".
You will need the same compiler to reproduce this bug.
This works correctly in C++ Builder XE8, which is earlier version of the
C++ Builder, and is using "classic Borland compiler". XE8 uses Boost
1.39.0.
That can be tested with the following program:
{{{
#include <tchar.h>
#define BOOST_THREAD_USE_LIB
#include <boost/thread.hpp>
#include <cstdio>
#include <cfloat>
extern "C" { namespace boost { void tss_cleanup_implemented() { } } }
void print_cw()
{
const unsigned int cw = _control87(0, 0);
printf("%X\n", cw);
}
void print_cw_2()
{
_fpreset();
print_cw();
}
int _tmain(int argc, _TCHAR* argv[])
{
print_cw();
boost::thread t2(&print_cw);
t2.join();
boost::thread t3(&print_cw_2);
t3.join();
getchar();
return 0;
}
}}}
When compiled with the classic compiler, the output is correct:
{{{
1372
1372
1372
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12330#comment:3> 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:20 UTC