https://bugs.kde.org/show_bug.cgi?id=432801
--- Comment #7 from Eyal <eyals...@gmail.com> --- It seems that the issue is the loop. When the length of pattern is more than 8, the code runs a routine that is able to sum 8 chars at a time. It uses xmm for this. It only enters that code if the number of bytes to sum is at least 8. I'm not sure why removing the call to sigaction matters. Maybe it's an alignment issue? Removing the `pattern[0] = '1'` allows the compiler to figure out that the pattern is a constant and the whole thing gets evaluated at compile-time, as if constexpr. That explains why the line is necessary to cause the bug. The routine to sum 8 bytes at once seems really long to me but I guess clang has decided that it's faster than doing extra jumps. If I can figure out how to have valgrind display the bit-validity values during processing, maybe I can see which instruction is getting instrumented incorrectly. I feel that this is a valgrind bug, not a clang bug. -- You are receiving this mail because: You are watching all bug changes.