[LLVMbugs] [Bug 20566] New: Clang miscompiles varargs function when targeting i686-pc-win32

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 6 13:22:31 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20566

            Bug ID: 20566
           Summary: Clang miscompiles varargs function when targeting
                    i686-pc-win32
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
#include <assert.h>
#include <stdarg.h>

#define CST 8573108
static void callee(long long a1, ...) {
  va_list ap;
  int l;

  va_start(ap, a1);
  l = va_arg(ap, int);
  assert(l == CST);
  va_end(ap);
}
int main(int argc, char **argv) {
  callee(1743452LL, CST);
  return 0;
}

This assert fires when compiled with clang, it passes just fine with MSVC.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140806/59559075/attachment.html>


More information about the llvm-bugs mailing list