Modify

Ticket #12411 (closed Bugs: fixed)

Opened 5 months ago

Last modified 7 weeks ago

Boost coroutines 1.61 do not preserve fpu registers with O2 optimizations in Visual Studio

Reported by: martin_haas@… 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

BoostCoroutineTest.cpp Download (6.7 KB) - added by martin_haas@… 5 months ago.
Source code to show coroutine issue

Change History

comment:1 Changed 5 months ago by olli

could you provide code that demonstrates the problem, please

Changed 5 months ago by martin_haas@…

Source code to show coroutine issue

comment:2 Changed 5 months ago by martin_haas@…

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 Changed 5 months ago by olli

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 Changed 8 weeks ago by olli

  • Component changed from coroutine to context

comment:5 Changed 8 weeks ago by olli

  • Severity changed from Showstopper to Problem

comment:6 follow-up: ↓ 7 Changed 7 weeks ago by olli

  • Status changed from new to closed
  • Resolution set to fixed

comment:7 in reply to: ↑ 6 ; follow-up: ↓ 8 Changed 7 weeks ago by martin_haas@…

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 in reply to: ↑ 7 Changed 7 weeks ago by anonymous

Replying to martin_haas@…:

Will this change in Boost Context be rolled into the Boost 1.63 release?

yes

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.