Modify

Opened 10 months ago

Closed 7 months ago

Last modified 7 months ago

#12411 closed Bugs (fixed)

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 (1)

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

Download all attachments as: .zip

Change History (9)

comment:1 Changed 10 months ago by olli

could you provide code that demonstrates the problem, please

Changed 10 months ago by martin_haas@…

Source code to show coroutine issue

comment:2 Changed 10 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 10 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 7 months ago by olli

  • Component changed from coroutine to context

comment:5 Changed 7 months ago by olli

  • Severity changed from Showstopper to Problem

comment:6 follow-up: Changed 7 months ago by olli

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

comment:7 in reply to: ↑ 6 ; follow-up: Changed 7 months 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 months ago by anonymous

Replying to martin_haas@…:

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

yes

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain olli.
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.