Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

CR6 not being set before a vararg call #10441

Closed Quuxplusone closed 13 years ago

Quuxplusone commented 13 years ago
Bugzilla Link PR10136
Status RESOLVED FIXED
Importance P normal
Reported by Roman Divacky (rdivacky@freebsd.org)
Reported on 2011-06-14 15:47:55 -0700
Last modified on 2011-06-14 17:16:49 -0700
Version trunk
Hardware PC FreeBSD
CC efriedma@quicinc.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
[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);
  }
Quuxplusone 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]$
Quuxplusone commented 13 years ago

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