Created attachment 74639 [details] Test case illustrating bsfl validity bit failure This is with current SVN (revision 13057). To reproduce: 1) Compile the attached program with "gcc -O3 -Wall -o test test.c" 2) Run "valgrind test" I expect this to produce no warnings, because even though the integer starts as an undefined value, the code explicitly clears its low bit and sets its second bit before calling __builtin_ffsl (aka. "bsfl"). Since all of the bits up to and including the first "1" are explicitly set, this program's behavior is perfectly deterministic; it is guaranteed to return "2" from main. Similar code shows up in certain optimized word-at-a-time string routines, so this is not just hypothetical. (And it will become even less hypothetical if we ever fix bug 294285.)
The patches posted to bug 308627 should also fix this bug.
*** This bug has been marked as a duplicate of bug 308627 ***