[LLVMbugs] [Bug 7814] New: possible integer wrong code bug on x64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Aug 4 13:37:42 PDT 2010


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

           Summary: possible integer wrong code bug on x64
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu, jxyang at cs.utah.edu


regehr at gamow work017]$ clang -O1 small.c -o small
[regehr at gamow work017]$ ./small
0
[regehr at gamow work017]$ clang -O2 small.c -o small
[regehr at gamow work017]$ ./small
1
[regehr at gamow work017]$ clang -v
clang version 2.8 (trunk 110207)
Target: x86_64-unknown-linux-gnu
Thread model: posix
[regehr at gamow work017]$ cat small.c
extern int printf (__const char *__restrict __format, ...);

unsigned short
foo (unsigned short ui1, unsigned short ui2)
{
  return ui1 * ui2;
}

signed char
bar (signed char left, int right)
{
  return 
    ((left < 0) || (right < 0) || (right >= 32))? 
    left : 
    (left >> right);
}


long g_16 = 0xCC1DAB9737E0D1B7LL;
int g_37 = -1L;
int g_38 = 0;
unsigned long g_381 = -1L;

void func_19 (long p_21)
{
  int x = foo (1L && g_16, p_21);
  if (0 < bar (x, 0)) {
    g_38 = 1;
  }
}

int main(void)
{
  func_19 (0x2EA21E1D82C32B96LL);
  printf("%d\n", g_38);
  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