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

            Bug ID: 97607
           Summary: Spurious sign extension
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: elronnd at elronnd dot net
  Target Milestone: ---

The following code

extern void fun(char);                                                          
void wrapper(char x) { fun(x); }

Should compile 'wrapper' to a single jump, but instead it does this (on amd64):

wrapper:
        movsx   edi, dil
        jmp     fun

Presumably 'x' is getting promoted to int in wrapper, and the promotion never
gets removed.

Reply via email to