Hacker News new | ask | show | jobs
by scottmac 5642 days ago
I've fixed this now in all the PHP branches.

http://svn.php.net/viewvc/?view=revision&revision=307095

1 comments

Interesting. I've never used 'volatile', would you mind explaining how it works in this case?
The copying from the 80-bit register to the 64-bit memory cell is causing the result to be corrupted. When we use volatile it tells the compiler not to apply the optimisation which in this case was putting it in a register.
But doesn't that make it a compiler bug? If the root cause is that the compiler truncates data it shouldn't, does that mean the fundamental issue is a compiler bug?
It's a hardware issue with the x87 instruction set,

http://gcc.gnu.org/ml/gcc/2003-08/msg01195.html is a good explanation.

Ah I see, thank you. Hairy problem.