On Thu, Dec 10, 2009 at 7:10 PM, Mike Stump <[email protected]> wrote:
> In the long run, if we want, we could analyze the asm code in detail, and
> improve what we think we know...
>
>>> Also, int foo() { asm("a: jump a"); } doesn't fall off the end.
>>> Essentially, trying to understand what is inside the asm is a dangerous
>>> thing.
>>
>> You're right, which is why we should follow gcc's policy of assuming it can
>> fall through!
The given code is technically undefined behavior per gcc docs; asm
blocks are required to flow through.
> It is annoying when
>
> int foo() {
> asm xor eax, eax
> }
>
> gives a warning.
If that actually works, it's pure luck. gcc warns because it's dangerous, no?
> Bear in mind, gcc's policy for:
>
> asm int foo() {
> xor eax, eax
> }
>
> is to _not_ give the warning.
Yes; we should follow gcc's lead here.
-Eli
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits