[LLVMbugs] [Bug 3275] New: math bug

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Dec 31 20:49:36 PST 2008


http://llvm.org/bugs/show_bug.cgi?id=3275

           Summary: math bug
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu


This bug is seen on Ubuntu Hardy on x86.

The history of this bug is interesting: versions up to and including 61026 do
the right thing.  Subsequent versions of llvm-gcc fail to build, reporting
bootstrap problems, until 61169, which builds but miscompiles this program. 
The bug remains up through 61514, the last one I tested.

regehr at john-home:~/volatile/tmp91$ llvm-gcc -O0 small.c -o small
regehr at john-home:~/volatile/tmp91$ ./small
32767
regehr at john-home:~/volatile/tmp91$ llvm-gcc -O1 small.c -o small
regehr at john-home:~/volatile/tmp91$ ./small
-1
regehr at john-home:~/volatile/tmp91$ cat small.c
#include <stdio.h>

short g_16;

void func_15 (void);
void func_15 (void)
{
  for (; g_16 < 1; g_16 = (short)((unsigned)g_16-1U))
    {
    }
}

int main (void)
{
  func_15 ();
  printf ("%d\n", g_16);
  return 0;
}


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list