[LLVMbugs] [Bug 20569] New: Clang miscompiles varargs function when targeting x86_64-pc-win32

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 6 14:39:59 PDT 2014


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

            Bug ID: 20569
           Summary: Clang miscompiles varargs function when targeting
                    x86_64-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>

static const struct S {
  int x[3];
} global = {{1, 2, 3}};

static void f(int arg, ...) {
  va_list ap;
  va_start(ap, arg);

  struct S s = va_arg(ap, struct S);
  assert(global.x[0] == s.x[0]);

  va_end(ap);
}

int main() {
  f(0, global);
  return 0;
}

This test succeeds using gcc, clang and 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/61631294/attachment.html>


More information about the llvm-bugs mailing list