This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]