[Bug rtl-optimization/71343] New: missed optimization (can't "prove" shift and multiplication equivalence)

SztfG at yandex dot ru gcc-bugzilla@gcc.gnu.org
Mon May 30 10:48:00 GMT 2016


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

            Bug ID: 71343
           Summary: missed optimization (can't "prove" shift and
                    multiplication equivalence)
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: SztfG at yandex dot ru
  Target Milestone: ---

this function

unsigned int test12(unsigned int a , unsigned int b)
{
  return ((a << 2) + (b << 2)) ==  a * 4 + b * 4;
}

cannot be reduced to "return 1;". Maybe here
https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/simplify-rtx.c?view=markup&pathrev=232689#l2118
needs to add something?

https://godbolt.org/g/vcEqe7 - here clang and ICC is able to reduce this, but
not gcc


More information about the Gcc-bugs mailing list