[cfe-commits] r126148 - in /cfe/trunk: include/clang/AST/Stmt.h lib/AST/Stmt.cpp lib/Sema/SemaStmt.cpp test/CodeGen/asm-inout.c

Chris Lattner clattner at apple.com
Mon Feb 21 15:13:00 PST 2011


On Feb 21, 2011, at 2:54 PM, Frits van Bommel wrote:

> On Mon, Feb 21, 2011 at 11:09 PM, Chris Lattner <sabre at nondot.org> wrote:
>> add one more case of mismatched input/output constraints.
>> When the mismatch is due to a larger input operand that is
>> a constant, truncate it down to the size of the output.  This
>> allows us to accept some cases in the linux kernel and elsewhere.
>> Pedantically speaking, we generate different code than GCC, though
>> I can't imagine how it would matter:
> 
> Does this handle explicit uses of registers that have operands tied to
> them? (e.g. an operand tied to 'a' and '%%eax' in the asm string)

Probably not!

> Does it handle instructions with implicit uses + input operands tied
> to those registers?
> For example, IIRC x86 integer division instructions implicitly use
> EAX, so I think truncating an input integer tied to 'a' could matter.

That's a good point, we don't catch that right now (and this issue already existed on mainline).  In practice, I'm not aware of any miscompilations that have happened due to that though.  Feel free to file a bugzilla.

-Chris



More information about the cfe-commits mailing list