The following function should just "return 1":
int f(int i)
{
  int i1 = i -2;
  if (i1 > i)
    return 0;
  return 1;
}
We miss this on the tree level, I found this while look into the following 
fortran code:
SUBROUTINE d ( a, b,n)
IMPLICIT NONE
INTEGER :: n
REAL,DIMENSION(n) :: a
REAL,DIMENSION(n) :: b
b(n-2:n) = sqrt(a(n-2:n))
END SUBROUTINE d


In final_cleanup, we have:
  D.679 = *n;
  S.2 = D.679 - 2;
  if (D.679 < S.2) goto L.1; else goto <L7>;

-- 
           Summary: missed always false conditional
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to