[LLVMbugs] [Bug 17158] New: likely wrong code bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Sep 8 12:59:23 PDT 2013


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

            Bug ID: 17158
           Summary: likely wrong code bug
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: regehr at cs.utah.edu
                CC: chenyang at cs.utah.edu, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

regehr at john-home ~/z/reduce/r108 $ clang -O1 -w small.c ; ./a.out 
1
regehr at john-home ~/z/reduce/r108 $ clang -O2 -w small.c ; ./a.out 
0
regehr at john-home ~/z/reduce/r108 $ cat small.c
int printf(const char *, ...);
struct x0 {
  int x1;
  char x2;
};
struct x3 {
  struct x0 x4;
  char x5;
} x6;
int main() {
  struct x3 x7 = { { 0, 0 }, 1 };
  x6 = x7;
  x7.x4.x2;
  printf("%d\n", x6.x5);
  return 0;
}
regehr at john-home ~/z/reduce/r108 $ clang -v
clang version 3.4 (trunk 190166)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7

-- 
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/20130908/eb223f5b/attachment.html>


More information about the llvm-bugs mailing list