Re:Avoid character-by-character processing when performance ...
by BeeOnRope on Saturday July 25, 2020 @09:41AM
(#23949085)
In practice this type of over-read is not uncommon in library code (even for standard routines), but I haven't seen compilers generate it. False positives with memory-sanitizers is definitely a problem: the hand-rolled library uses can be whitelisted, but that's not feasible once the compiler starts generating it in arbitrary code.
Emitting OoB reads dependent on optimization level? Think about ASAN, debugger watchpoints...can't be worth it!
clang has a cool feature that highlights missed vectorization opportunities:
love it!