Implicit def after printf call

Hello all,

I'm seeing some unexpected behavior with codegen. Can anyone shed some light on the llvm-generated ASM comment "#IMPLICIT DEF %eax"? I found a note somewhere saying that it describes "registers that are live on input
to the function."

Here are the relevant llvm instructions from my testcase (which look

%r3844 = call i32 (i8*, ...)* @printf( i8* getelementptr (i8* bitcast ([663 x i64]* @"initialized$$$CFE_id_786aaaf0_08b61fc9" to i8*), i64 1512));
%r3858 = volatile load i32* bitcast ([1 x i64]* @bGotUsr1Signal to i32*); %r3859 = icmp eq i32 %r3858, 0 ; <i1> [#uses=1]

Here's the x86-64 ASM code that gets generated (which doesn't look

call (printf)
testl %eax, %eax

Wouldn't the call to printf clobber EAX's contents before its use? Could
the volatile load be causing this problem?

Does this look like a bug (and should it be posted on llvmbugs)? Or, perhaps
I am missing something? Any help would be most appreciated!



This looks like a bug. Please file a bugzilla report, including a self-contained .ll file (one we can do "llvm-as < t.ll | llc" with)