|
|
| Bugzilla Link |
590 |
| Resolution |
FIXED |
| Resolved on |
Feb 22, 2010 12:42 |
| Version |
1.4 |
| OS |
All |
| Reporter |
LLVM Bugzilla Contributor |
Extended Description
llvm-gcc miscompiles the following function:
void zero(char *p, int n) {
int i;
int out, undef;
for (i = 0; i < n+1; ++i) {
out = undef;
undef = 0;
if (i > 0)
p[i-1] = out;
}
}
This function zeros out n locations starting at p. (out is undefined on iteration 0 of the loop, but it is
not written there.) llvm-gcc miscompiles this function to ret void. I have narrowed the problem down
to the scalarrepl pass. When I compile with scalarrepl in, it fails, and with scalarrepl out it succeeds.