Kinda like PR 14490 but for the -fwrapv and unsigned cases:

void bar (void);

void
foo (unsigned a)
{
  if (a < 100)
    return;
  if (200 < a)
    return;

  if (a - 10 > 150)
    bar ();
}


-- 
           Summary: Simplify "a - 10 > 150" into "a > 160" when range of a
                    is known (in VRP or somewhere else)
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27109

Reply via email to