[LLVMbugs] [Bug 20547] New: Miscompilation for variadic function call

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 5 12:02:08 PDT 2014


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

            Bug ID: 20547
           Summary: Miscompilation for variadic function call
           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 _[5];
} s;
#define CST 1779363874
void callee_b0f(int a1, int a2, int a3, int a4, struct S a5, int a6, int a7,
                ...) {
  va_list ap;
  va_start(ap, a7);
  int c = va_arg(ap, int);
  assert(CST == c);
}
int main() {
  callee_b0f(0, 0, 0, 0, s, 0, 0, CST);
  return 0;
}

compiling this on a x86_64-unknown-linux-gnu fires an assert, gcc 4.6.3
compiles this just fine.

-- 
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/20140805/8d669585/attachment.html>


More information about the llvm-bugs mailing list