We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ cat 1.cc
__m128d f(double a, double b) { __m128d v = _mm_cmpneq_sd(_mm_load_sd(&a), _mm_load_sd(&b)); return v; }
int main() { double a = 1.; double b = 2.; double * volatile pa = &a; double * volatile pb = &b; __m128d c = f(a, b); return c[0] + c[1]; }
$ ./bin/clang++ ../llvm/1.cc -fsanitize=memory -O1 -g && PATH=bin:$PATH ./a.out ==32151==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x4863e7 in f(double, double) /code/build-llvm/../llvm/1.cc:4:15 #1 0x4864bd in main /code/build-llvm/../llvm/1.cc:13:15
The text was updated successfully, but these errors were encountered:
Ah, return c[0] + c[1] is technically incorrect, because the second half of c is garbage. But MSan crash happens earlier anyway.
Sorry, something went wrong.
This should be fixed in r267966 + r267967
No branches or pull requests
$ cat 1.cc
include <emmintrin.h>
__m128d f(double a, double b) {
__m128d v = _mm_cmpneq_sd(_mm_load_sd(&a), _mm_load_sd(&b));
return v;
}
int main() {
double a = 1.;
double b = 2.;
double * volatile pa = &a;
double * volatile pb = &b;
__m128d c = f(a, b);
return c[0] + c[1];
}
$ ./bin/clang++ ../llvm/1.cc -fsanitize=memory -O1 -g && PATH=bin:$PATH ./a.out
==32151==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x4863e7 in f(double, double) /code/build-llvm/../llvm/1.cc:4:15
#1 0x4864bd in main /code/build-llvm/../llvm/1.cc:13:15
The text was updated successfully, but these errors were encountered: