[cfe-commits] r122643 - in /cfe/trunk: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGStmt.cpp test/CodeGen/asm-variable.c
dalej at apple.com
Mon Jan 3 17:15:28 CST 2011
On Jan 3, 2011, at 2:56 PM, Jakob Stoklund Olesen wrote:
>> I haven't looked at the patches, but clang should generate the same thing llvm-gcc generates for the same constructs. If you do that it will work; if you do anything else you'll probably hit subtle bugs.
> Rafael's patch only works for local variable, and it only tweaks the inline asm constraints where the variable is used as an operand. It does not insert inline asm around all uses like llvm-gcc does. As I am reading the GCC documentation, it doesn't have to.
> The GCC documentation does not require that the variable be pinned to the register at all times, and we definitely don't want to guarantee that.
> Dale, do you remember cases where it was necessary to insert empty inline asm around other uses, like llvm-gcc does?
The constructed example in 8305081 is fairly stressful. The code clang generates appears functionally correct, depending how you define that. People using these constructs, and asm in general, tend to regard extra moves inserted by the compiler as wrong. llvm has never been perfect about that, but the llvm-gcc code does a better job of getitng rid of them than the clang code.
It looks like it works well enough that we can wait for people to complain about it, let me put it that way:)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits