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

            Bug ID: 97743
           Summary: Failure to optimize boolean multiplication to select
           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(bool b)
{
    return b * 743;
}

This can be optimized to `return b ? 743 : 0;`. This optimization is done by
LLVM, but not GCC.

Reply via email to