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

            Bug ID: 91385
           Summary: Zero-extended negation (*negsi2_1_zext) is not
                    generated
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ubizjak at gmail dot com
  Target Milestone: ---

Following testcase:

unsigned long
foo (int a)
{
  return (unsigned) -a;
}

should use *negsi2_1_zext instruction, but compiles (-O2) to:

        negl    %edi    # 6     [c=4 l=2]  *negsi2_1
        movl    %edi, %eax      # 7     [c=1 l=2]  *zero_extendsidi2/3

Reply via email to