<p dir="ltr">Nice, thank you</p>
<div class="gmail_quote">30.01.2015 18:24 ÐÏÌØÚÏ×ÁÔÅÌØ "Malte Vesper" <<a href="mailto:malte.vesper@postgrad.manchester.ac.uk">malte.vesper@postgrad.manchester.ac.uk</a>> ÎÁÐÉÓÁÌ:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Spinlocks imply memory barriers as far as I am aware...<br>
<br>
Read here: <a href="http://lxr.free-electrons.com/source/Documentation/memory-barriers.txt#L1634" target="_blank">http://lxr.free-electrons.com/<u></u>source/Documentation/memory-<u></u>barriers.txt#L1634</a><br>
<br>
On 30/01/15 14:20, Matwey V. Kornilov wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2015-01-30 16:52 GMT+03:00 buyitian <<a href="mailto:buyitian@gmail.com" target="_blank">buyitian@gmail.com</a>>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Please check the assembly code to double confirm the GCC behavior.<br>
Why will GCC change the order as what you mentioned? Only assembly code can tell you.<br>
</blockquote>
It does not change at the moment. I think it can change it.<br>
<br>
Because from line<br>
š šret = hdl->count;<br>
until line<br>
š šreturn ret;<br>
there is no access to either ret or hdl->count. So it is reasonable to<br>
optimizer to think that their values are the same and eliminate<br>
unneeded variable.<br>
<br>
</blockquote>
<br>
</blockquote></div>