#12411 closed Bugs (fixed)
Boost coroutines 1.61 do not preserve fpu registers with O2 optimizations in Visual Studio
Reported by: | Owned by: | olli | |
---|---|---|---|
Milestone: | To Be Determined | Component: | context |
Version: | Boost 1.61.0 | Severity: | Problem |
Keywords: | fpu registers | Cc: |
Description
When compiling program with O2 optimization setting, coroutine function is not preserving the fpu registers. This does work correctly in 1.60, but not 1.61. I saw that this attribute was removed in 1.61.
Attachments (1)
Change History (9)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Please see the attached file. When compiled with Visual Studio 2015, the Debug versions work correctly. The release version works correctly if optimization is disabled. If optimization is specified as O2 or Ox, it appears the fpu registers are being cleared. In the working versions, the final job completes at time 54. In the nonworking versions, the final job appears to take zero time, so it completes at time 44.
if the "hold" function is changed to return an int instead of a double, the optimized programs work correctly.
The program works correctly with boost 1.60, but not 1.61.
Thanks for all your hard work. The performance of the coroutines are MUCH better than my current solution. Hope this is an easy fix.
Thanks
comment:3 by , 6 years ago
unfortunately, boost.coroutine is deprecated and will not be fixed or developed further. You coud use boost.context, boost.coroutine2 (no symmetric coroutines) or boot.fiber instead.
For the problem you mentioned - could you provide a simple example using boost.context that demonstrates problems with the FPU env, please?
comment:4 by , 6 years ago
Component: | coroutine → context |
---|
comment:5 by , 6 years ago
Severity: | Showstopper → Problem |
---|
follow-up: 7 comment:6 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 8 comment:7 by , 6 years ago
Replying to olli: Thanks Oliver. I verified that the change worked for me. Will this change in Boost Context be rolled into the Boost 1.63 release?
Thanks
comment:8 by , 6 years ago
Replying to martin_haas@…:
Will this change in Boost Context be rolled into the Boost 1.63 release?
yes
could you provide code that demonstrates the problem, please