[llvm-commits] [llvm] r116665 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/MachineModuleInfo.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/Target/X86/X86AsmPrinter.cpp test/CodeGen/X86/fltused.ll

Duncan Sands baldrick at free.fr
Mon Oct 18 01:13:47 PDT 2010


Hi Michael,

>>> X86-Windows: Emit an undefined global __fltused symbol when targeting Windows
>>> if any floating point arguments are passed to an external function.
>>
>> why?
>
> Because the Microsoft C standard library requires it. If you don't
> printf("%f", 1.0); would fail via a call to abort. An unknown set of
> functions have this behavior.

thanks for the explanation.  If I understand right, this is only needed when
calling functions in the Microsoft C standard library, notably printf and
scanf but maybe others.

> You are correct about indirect calls. As for varargs, the test I added
> was explicitly for printf. The CallInst is the call-site. I only use
> the function type to avoid checking function calls which obviously
> cannot lead to library calls.

Yes, I misread your patch: I thought you were only checking the arguments of
the function type, but in fact you were indeed checking the callsite.

Ciao,

Duncan.



More information about the llvm-commits mailing list