[LLVMbugs] [Bug 15135] New: bug in basic arithmetic in trunk

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 1 00:06:20 PST 2013


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

             Bug #: 15135
           Summary: bug in basic arithmetic in trunk
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: kcc at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The fresh trunk has a bug in basic arithmetic: 
% clang --version
clang version 3.3 (trunk 174153)
Target: x86_64-unknown-linux-gnu
Thread model: posix
% cat shift_bug.cc 
#include <stdio.h>
unsigned foo(int l) {
  return 1 << (l - 3);
}
int main() {
  printf("res: %u\n", foo(7));
}
% clang -O shift_bug.cc ; ./a.out
res: 0
% clang shift_bug.cc ; ./a.out
res: 16
% gcc shift_bug.cc ; ./a.out
res: 16
%

-- 
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