https://llvm.org/bugs/show_bug.cgi?id=28504
Bug ID: 28504 Summary: Wrong constant folding Product: clang Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: ishiura-compi...@ml.kwansei.ac.jp CC: llvm-bugs@lists.llvm.org Classification: Unclassified LLVM + clang 3.9 for x86_64 miscompiles the following code. % cat test.c int main (void) { signed char c = 1; int i = (short) (signed char) ( c - (unsigned char) c + (c==1) ) ; short s = c; if (i != 1) __builtin_abort(); return 0; } % clang-3.9 test.c % ./a.out zsh: abort (core dumped) ./a.out % clang-3.9 -v clang version 3.9.0 (trunk 274023) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /xxxxx/bin Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.1 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.1 Candidate multilib: .;@m64 Selected multilib: .;@m64 -- 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