https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99393
Bug ID: 99393
Summary: Unoptimized tailcall with char and short as parameter
(x86)
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jonathan.poelen at gmail dot com
Target Milestone: ---
#include <cstdint>
int foo(uint8_t x);
int foo(uint32_t x);
struct Y { uint8_t x; };
struct X { uint32_t x; };
int foo(Y x);
int foo(X x);
e(unsigned char):
movzx edi, dil <--- unnecessary mov
jmp foo(unsigned char)
g(unsigned int):
jmp foo(unsigned int)
i(Y):
jmp foo(Y)
j(X):
jmp foo(X)
https://godbolt.org/z/K1vYc4