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

            Bug ID: 104297
           Summary: MIN_EXPR is not detected for a >= -__INT_MAX__  ?
                    -__INT_MAX__  : a
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
int t(int a)
{
    int b = -__INT_MAX__ ;
    int c = a >= b ? b : a;
    return c;
}

int t1(int a)
{
    int c = a >= -__INT_MAX__  ? -__INT_MAX__  : a;
    return c;
}

--- CUT ---
t1 should be detected to MIN_EXPR <a_2(D), -2147483647>;

Reply via email to