http://llvm.org/bugs/show_bug.cgi?id=15522
Bug ID: 15522
Summary: Loop Optimizer Problems
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
#include <stdio.h>
#include <stdlib.h>
int main()
{
long buf[2];
long *pvalue = &buf[0];
long *pj = &buf[1];
long *pi = &buf[2];
for(*pj=0; *pj<1000000; (*pj)++)
{
*pvalue = 0;
for(*pi=0; *pi<1000; (*pi)++)
{
*pvalue += (*pi)+1;
}
}
printf("%ld\n", *pvalue);
}
when I compile it with:clang main.c -O3
the result is 0
--
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