[LLVMbugs] [Bug 2294] New: possible integer codegen bug

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue May 6 15:14:23 PDT 2008


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

           Summary: possible integer codegen 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


Using recent svn on x86-32 the code below behaves differently at -O0 and -O1. 
Clearly there's an integer overflow happening but the behavior difference is
still evident when -fwrapv is specified, so this seems like a bug.

#include <stdio.h>

short g_2 = 1;
int volatile g_5 = 0;

void func_1(void) ;
void func_1(void) 
{ 
  int tmp ;
  while (g_2 > 0) {
    if (!g_2) {
      tmp = g_5;
    }
    g_2++;
  }
}

int main(void) 
{ 
  func_1();
  printf("%d\n", g_2);
  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