[Bug tree-optimization/94782] New: Simple multiplication-related arithmetic not optimized to direct multiplication

gabravier at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 27 02:08:53 GMT 2020


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

            Bug ID: 94782
           Summary: Simple multiplication-related arithmetic not optimized
                    to direct multiplication
           Product: gcc
           Version: 10.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(int a, int b)
{
    return (int)((a - 1U) * b) + b;
}

Can be optimized to `a * b`. LLVM does this transformation, GCC does not.

Comparison here : https://godbolt.org/z/LFJwFJ


More information about the Gcc-bugs mailing list