https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99384

            Bug ID: 99384
           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);

int d(uint8_t x) { return foo(x); }
int g(uint32_t x) { return foo(x); }
int i(Y x) { return foo(x); }
int j(X x) { return foo(x); }


d(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
  • [Bug c++/99384] New: Unoptim... jonathan.poelen at gmail dot com via Gcc-bugs

Reply via email to