https://llvm.org/bugs/show_bug.cgi?id=26994
Bug ID: 26994 Summary: wrong code at -O1 and above in 32-bit mode on x86_64-linux-gnu Product: clang Version: trunk Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: chengnian...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified The following code is miscompiled by the trunk at -O1 and above in 32-bit mode on x86_64-linux-gnu. This bug also affects clang-3.7 and later versions. $: clang-trunk -v clang version 3.9.0 (trunk 263789) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/local/bin Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8 Candidate multilib: .;@m64 Candidate multilib: 32;@m32 Candidate multilib: x32;@mx32 Selected multilib: .;@m64 $: $: clang-trunk small.c -O3 -m32 ; ./a.out ; echo $? 1 $: clang-trunk small.c -O1 -m32 ; ./a.out ; echo $? 1 $: clang-trunk small.c -O0 -m32 ; ./a.out ; echo $? 0 $: clang-3.7 small.c -O1 -m32 ; ./a.out ; echo $? 1 $: cat small.c int main () { int *p = 0; trick: if (p) return *p; int x = 0; p = &x; goto trick; return 0; } $: -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs