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

            Bug ID: 94889
           Summary: Negate function not getting optimised to negate call
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: satanichiya at waifu dot club
  Target Milestone: ---

int func(int x)
{
    for(int i=0;i<sizeof(int)*8;i++)
    {
        x ^= (int)1<<i;
    }
    return x;
}

Does not get optimised to just a negate instruction

Reply via email to