https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121846
Bug ID: 121846
Summary: call to memcpy with zero value n argument triggers
deletion of null pointer check optimization
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: rcseacord at gmail dot com
Target Milestone: ---
Calls to memcpy with zero value n argument triggers deletion of null pointer
check optimization. There is no null pointer dereference and this is not UB
IMHO. See https://github.com/Juniper/libxo/issues/90 for more information.