Bug #74843 MYSQL_BIN_LOG::m_prep_xids doesn't need to be volatile
Submitted: 13 Nov 2014 22:24 Modified: 30 Apr 2015 12:47
Reporter: Stewart Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7.7 OS:Any
Assigned to: CPU Architecture:Any

[13 Nov 2014 22:24] Stewart Smith
Description:
volatile forces the compiler to create load/store instructions. However, m_prep_xids is accessed entirely through atomics, which will do the right thing anyway, so volatile is, in fact, completely unneeded.

How to repeat:
code analysis! You can probably see extra loads in the asm.

Suggested fix:
Apply my patch! (attached)
[13 Nov 2014 22:25] Stewart Smith
make m_prep_xids not volatile

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: volatile-binlog-prepxids.patch (text/x-patch), 1.16 KiB.

[17 Nov 2014 8:50] MySQL Verification Team
Hello Stewart,

Thank you for the report and contribution.

Thanks,
Umesh
[10 Apr 2015 8:04] Stewart Smith
Still a problem in 5.7.7.
[30 Apr 2015 12:47] David Moss
Thanks for your feedback and the patch.
This has been fixed in the upcoming 5.7.8 release.