llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.06k stars 11.59k forks source link

CR6 not being set before a vararg call #10508

Closed llvmbot closed 13 years ago

llvmbot commented 13 years ago
Bugzilla Link 10136
Resolution FIXED
Resolved on Jun 14, 2011 17:16
Version trunk
OS FreeBSD
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic

Extended Description

[rdivacky@anacreon ~/llvm]$ cat printf.c int printf(const char *, ...); int main() { float f = 3.13; printf("%f", f); } [rdivacky@anacreon ~/llvm]$ ./Release+Asserts/bin/clang -m32 -O2 -S -o - printf.c | grep creq creqv 0, 0, 0 [rdivacky@anacreon ~/llvm]$ gcc -m32 -O2 -S -o - printf.c | grep creq creqv 6,6,6

the CR6 is not being, it looks like it's being overwritten as the code there suggests it should be there:

// Set CR6 to true if this is a vararg call. if (isVarArg) { SDValue SetCR(DAG.getMachineNode(PPC::CRSET, dl, MVT::i32), 0); Chain = DAG.getCopyToReg(Chain, dl, PPC::CR1EQ, SetCR, InFlag); InFlag = Chain.getValue(1); }

efriedma-quic commented 13 years ago

r133018; I would appreciate if you would write/commit an appropriate test.

llvmbot commented 13 years ago

oh, forgot to mention that it works just fine at -O0

[rdivacky@anacreon ~/llvm]$ ./Release+Asserts/bin/clang -m32 -O0 -S -o - printf.c | grep creq creqv 6, 6, 6 [rdivacky@anacreon ~/llvm]$