this is a critical wrong-codegen bug in gcc 9 and 10 that can have security impact, and oddly the fix still does not seem to have been backported, so just disable builtin memcmp expansion entirely until there's a known-good fix.
0017-pr93402.diff was dropped, as it was merged upstream.