The following testcase aborts with gcc 3.4, 4.0 and 4.1 when optimizing.  It
looks like combine is removing the condition here.
#include <limits.h>

void abort ();
void exit (int);

void f (int a) {
        if (abs(a) < 0)
          return;
        abort ();
}

int main (int argc, char *argv[]) {
        f (INT_MIN);
        exit (0);
}

-- 
           Summary: Combine ignores flag_wrapv
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: phython at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to