On 18/04/2024 12:09 pm, Jan Beulich wrote: > On 16.04.2024 17:52, Andrew Cooper wrote: >> Misra Rule 21.16 doesn't like the use of memcmp() between a string literal >> and >> a UINT8 array. Rewrite using plain compares. >> >> No functional change. >> >> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> > Reviewed-by: Jan Beulich <jbeul...@suse.com>
Thanks. > after having realized that sadly gcc13 instantiates the compound literals > (that I had thought of using) in .rodata (or one of its variants), rather > than leveraging them being as constant as string literals. gcc10 manages to optimise both checks to a cmp{w,l}, which I did check before sending the patch. However, it chooses a different base register for the cmpl and there's a sad cascade effect where a bunch of JMP disp8's turn into disp32's. But oh well - it's init code. ~Andrew