Commit a42062b1 by Igor Zamyatin Committed by Ilya Enkovich

re PR target/66326 (Floating point exception with -mfpmath=387 and -fcilkplus.)

libcilkrts/

2015-11-09  Igor Zamyatin  <igor.zamyatin@intel.com>

	PR target/66326
	* runtime/config/x86/os-unix-sysdep.c (sysdep_save_fp_ctrl_state):
	Use fnstcw instead fnstsw.


gcc/testsuite

2015-11-09  Igor Zamyatin  <igor.zamyatin@intel.com>

	PR target/66326
	* g++.dg/cilk-plus/CK/pr66326.cc: New test.

From-SVN: r230008
parent 00402c94
2015-11-09 Igor Zamyatin <igor.zamyatin@intel.com>
PR target/66326
* g++.dg/cilk-plus/CK/pr66326.cc: New test.
2015-11-09 Richard Henderson <rth@redhat.com>
* gcc.target/i386/addr-space-1.c: New test.
......
/* { dg-options "-fcilkplus" } */
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-fcilkplus -lcilkrts" { target { i?86-*-* x86_64-*-* } } } */
#include <cilk/cilk.h>
#include <vector>
#include <random>
template <class T>
void do_not_optimize_away(T&& x) {
asm volatile("" : "+r"(x));
}
const int N = 1'000'000;
auto compute() {
std::vector<double> v(N);
auto rng = std::mt19937{std::random_device{}()};
std::uniform_real_distribution<double> dist(0, 1);
for (int i = 0; i < N; ++i) v[i] = std::log(std::sqrt(dist(rng)));
return v;
}
int main() {
std::vector<double> v1, v2, v3;
cilk_spawn [&] { v1 = compute(); }();
cilk_spawn [&] { v2 = compute(); }();
v3 = compute();
do_not_optimize_away(v1.data());
do_not_optimize_away(v2.data());
do_not_optimize_away(v3.data());
return 0;
}
2015-11-09 Igor Zamyatin <igor.zamyatin@intel.com>
PR target/66326
* runtime/config/x86/os-unix-sysdep.c (sysdep_save_fp_ctrl_state):
Use fnstcw instead fnstsw.
2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
* Makefile.in: Regenerated with automake-1.11.6.
......
......@@ -135,7 +135,7 @@ void sysdep_save_fp_ctrl_state(__cilkrts_stack_frame *sf)
{
__asm__ ("stmxcsr %0" : "=m" (sf->mxcsr));
}
__asm__ ("fnstsw %0" : "=m" (sf->fpcsr));
__asm__ ("fnstcw %0" : "=m" (sf->fpcsr));
}
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment