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

            Bug ID: 95393
           Summary: Failure to optimize loop condition arithmetic for
                    mismatched types
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int f(unsigned s)
{
    int i;
    for (i = 0; i < s; ++i)
        ;

    return i;
}

This can be optimized to `return s;`. LLVM does this transformation, but GCC
does not.

Reply via email to