[LLVMbugs] [Bug 726] NEW: Incorrect compilation of some integer arithmetic
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Fri Mar 31 05:43:32 PST 2006
http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=726
Summary: Incorrect compilation of some integer arithmetic
Product: libraries
Version: 1.6
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Loop Optimizer
AssignedTo: unassignedbugs at nondot.org
ReportedBy: richard at tartarus.org
I entered the following source file in the web demo of LLVM at
http://llvm.org/demo/index.cgi
(and selected the language of the input data to be C.)
int main(void) {
int a;
int b = 0;
for (a = 10; a > 7; a--) b+=a;
return b;
}
I would expect the main function to return 27, but instead it returns
-2147483621. This is exactly 2^31 less than the expected value. The displayed
output for the main function is:
int %main() {
loopexit:
tail call void %__main( )
ret int -2147483621
}
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the llvm-bugs
mailing list