Created
August 10, 2017 11:14
-
-
Save LebedevRI/b6291e37fe0e310e9072e2c54cc6da08 to your computer and use it in GitHub Desktop.
some strange llvm miscompile?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
int main () { | |
unsigned short dest[128]; | |
int pred[2]; | |
pred[0] = dest[0]; | |
pred[1] = dest[1]; | |
for (int x = 2; x < 666; x += 2) { | |
int diff[2]; | |
// else, read next difference from the the output | |
diff[0] = dest[x]; | |
diff[1] = dest[x + 1]; | |
// else, do prediction, store predicted values | |
pred[0] += diff[0]; | |
pred[1] += diff[1]; | |
dest[x] = pred[0]; | |
dest[x + 1] = pred[1]; | |
assert(dest[x] == pred[0]); | |
assert(dest[x + 1] == pred[1]); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment