http://llvm.org/bugs/show_bug.cgi?id=5387
Summary: incorrect integer conversion with -O1
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: LLVM Codegen
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected],
[email protected]
Using trunk 85610, the code below shows wrong behavior. The for loop should be
infinite.
y...@yang-working:~$ clang -O1 -o small small.c
y...@yang-working:~$ ./small
Done!
y...@yang-working:~$ cat small.c
#include <stdio.h>
static unsigned short foo(unsigned short ui1, unsigned short ui2)
{
return (ui1 - ui2);
}
static int bar(void)
{
int l_2 = 0;
for (l_2 = -1; (l_2 > -25); l_2 = foo(l_2, 1))
{
}
return 0;
}
int main(void)
{
bar();
printf("Done!\n");
return 0;
}
y...@yang-working:~$ clang -v
clang version 1.1 (trunk 85610)
Target: i386-pc-linux-gnu
Thread model: posix
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs