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 tree-optimization/66423] New: a % (1 << b) no longer gets folded to a & (1 << b) for unsigned a and b


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

            Bug ID: 66423
           Summary: a % (1 << b) no longer gets folded to a & (1 << b) for
                    unsigned a and b
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

Test case:

unsigned int
my_mod (unsigned int a, unsigned int b)
{
    return a % (1 << b);
}

no longer gets folded to a & (1 << b).

I have not done a bisection but it may be that r223690 is the cause.


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