<p dir="ltr"><br>
On 13 Aug 2012 23:12, "Abramo Bagnara" <<a href="mailto:abramo.bagnara@gmail.com">abramo.bagnara@gmail.com</a>> wrote:<br>
><br>
> Il 13/08/2012 23:54, Eli Friedman ha scritto:<br>
> > On Mon, Aug 13, 2012 at 2:01 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> >> According to the documentation I can find[1], multiple __asm constructs are<br>
> >> separate statements. In particular, the documentation suggests that here:<br>
> >><br>
> >> void f() {<br>
> >> if (false)<br>
> >> __asm mov eax, ebx<br>
> >> __asm mov ebx, eax<br>
> >> }<br>
> >><br>
> >> the second __asm statement is not controlled by the 'if'. If the<br>
> >> documentation is correct, we currently misparse this.<br>
> >><br>
> >> [1] <a href="http://msdn.microsoft.com/en-us/library/45yd4tzz(v=vs.110).aspx">http://msdn.microsoft.com/en-us/library/45yd4tzz(v=vs.110).aspx</a><br>
> ><br>
> > I think clang's interpretation is actually right here, but someone<br>
> > should actually try that on MSVC.<br>
><br>
> void f(int x) {<br>
> if (x)<br>
> __asm out dx, ax<br>
> __asm out dx, ax</p>
<p dir="ltr">What about these:</p>
<p dir="ltr"> if (x)<br>
__asm out dx, ax __asm out dx, ax<br>
if (x)<br>
__asm out dx, ax ; __asm out dx, ax<br>
if (x)<br>
__asm out dx, ax ; out dx, ax</p>
<p dir="ltr">To my reading, the first two are two statements and the third is one statement.</p>
<div class="gmail_quote">On 13 Aug 2012 23:12, "Abramo Bagnara" <<a href="mailto:abramo.bagnara@gmail.com">abramo.bagnara@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Il 13/08/2012 23:54, Eli Friedman ha scritto:<br>
> On Mon, Aug 13, 2012 at 2:01 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
>> According to the documentation I can find[1], multiple __asm constructs are<br>
>> separate statements. In particular, the documentation suggests that here:<br>
>><br>
>> void f() {<br>
>> if (false)<br>
>> __asm mov eax, ebx<br>
>> __asm mov ebx, eax<br>
>> }<br>
>><br>
>> the second __asm statement is not controlled by the 'if'. If the<br>
>> documentation is correct, we currently misparse this.<br>
>><br>
>> [1] <a href="http://msdn.microsoft.com/en-us/library/45yd4tzz(v=vs.110).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/45yd4tzz(v=vs.110).aspx</a><br>
><br>
> I think clang's interpretation is actually right here, but someone<br>
> should actually try that on MSVC.<br>
<br>
void f(int x) {<br>
if (x)<br>
__asm out dx, ax<br>
__asm out dx, ax<br>
if (x)<br>
__asm out dx, ax;<br>
__asm out dx, ax;<br>
if (x)<br>
__asm { out dx, ax };<br>
__asm { out dx, ax };<br>
if (x)<br>
__asm { out dx, ax }<br>
__asm { out dx, ax }<br>
}<br>
<br>
<br>
For all these case Microsoft Visual C++ 2010 Express has the very same<br>
interpretation that Richard describes and conformant to the documentation.<br>
<br>
<br>
</blockquote></div>