https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95439
Bug ID: 95439
Summary: Incorrect zero count check in cmpstrnsi
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: hubicka at ucw dot cz, ubizjak at gmail dot com
Target Milestone: ---
Target: i386,x86-64
cmpstrnsi expander has
emit_insn (gen_cmp_1 (Pmode, countreg, countreg));
emit_insn (gen_cmpstrnqi_1 (addr1, addr2, countreg, align,
operands[1], operands[2]));
to guard against zero count. But it checks equality, not zero.