Incorrect code is generated for the following program which I believe should
finish with "return 0" and not abort.

This was compiled with
gcc test.c
(no options).

I believe this bug is also present in gcc 4.0.3


int f(int x) __attribute__((noinline));

int f(int x)
{
    if (x < 0) 
        abort();
}

int main(void)
{ 
    int x;

    for (x = 0; x < 0x7fffffff; x += 0x10000001) 
        f(x);

    return 0;
}


-- 
           Summary: Incorrect code generated for comparison
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michael dot chapman at cortus dot com
  GCC host triplet: i386-redhat-linux


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

Reply via email to