[PATCH v1] x86: memcmp-avx2-movbe.S and memcmp-evex-movbe.S fix overflow bug.

Paul Eggert eggert@cs.ucla.edu
Mon Jun 7 19:51:14 GMT 2021


On 6/7/21 11:07 AM, Noah Goldstein wrote:
>   What do we want the behavior to be? Generally I would think
> failing silently can be quite painful for users.

Traditionally we have typically said to go for the best typical-case 
performance, and not to worry about how that affects undefined behavior.

So, for example, glibc's memcmp ((void *) 1, NULL, 0) does not dump core 
even though its behavior is undefined, because it would slow glibc down 
to force memcmp to dump core for that case.

A debugging library like valgrind's might choose to crash more reliably.


More information about the Libc-alpha mailing list