[LLVMbugs] [Bug 21160] New: Wrong code
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Oct 4 17:56:47 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=21160
Bug ID: 21160
Summary: Wrong code
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
Assignee: unassignedclangbugs at nondot.org
Reporter: ishiura-compiler at ml.kwansei.ac.jp
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
LLVM + clang 3.6 for x86_64 miscompiles the following code with optimize option
"-O1".
We have tried hard to minimize the code, but this is the best result we have
obtained so far.
$ cat test.c
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
int g = 0;
int h = 0;
int i = 0;
int j = 0;
int k = 0;
int l = 0;
int m = 0;
int n = 0;
int o = 0;
int p = 0;
int main (void)
{
volatile int q = 0;
volatile int r = 0;
volatile int s = 0;
volatile int t = 0;
volatile int u = 0;
for (i = 0; i < 1; i++) {
volatile int v = 1;
a = m + 1;
b = n;
c = 1 / v;
d = r + o;
e = t;
f = p + t;
g = a + 1;
h = g + q;
j = s;
k = r + l;
}
int w = g | (int)(16777219.0L + u);
if (w != 16777219) {
__builtin_abort();
}
return 0;
}
$ clang test.c -O1
$ ./a.out
Aborted (core dumped)
$ clang -v
clang version 3.6.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
--
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/20141005/3916999b/attachment.html>
More information about the llvm-bugs
mailing list