[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [LLVMbugs] [Bug 671] NEW: switch statement miscompilation
From:       bugzilla-daemon () cs ! uiuc ! edu
Date:       2005-11-29 0:50:33
Message-ID: 200511290050.SAA26814 () zion ! cs ! uiuc ! edu
[Download RAW message or body]

http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=671

           Summary: switch statement miscompilation
           Product: libraries
           Version: 1.6
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Miscellaneous Instrumentation passes
        AssignedTo: unassignedbugs@nondot.org
        ReportedBy: markus@oberhumer.com


llvm 1.6 miscompiles the switch statement below. Looking at the C output it does
incorrectly cast v to unsigned.

~Markus


#include <stdio.h>

int foo(long long v) {
    switch (v) {
    case 0:
        return 1;
    case -1:
        return 2;
    }
    return 0;
}

int main() {
    int r = foo(4294967295LL);
    printf("foo = %d\n", r);
    return r;
}



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic