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

            Bug ID: 94914
           Summary: Failure to optimize check of high part of 64-bit
                    result of 32 by 32 multiplication into overflow check
           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: ---

bool f(uint32_t x, uint32_t y)
{
    return (((uint64_t)x * y) >> 32) != 0;
}

This can be optimized an overflow check on a 32-bit multiplication. LLVM does
this transformation, but GCC does not.

Reply via email to