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

           Summary: bug?
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [email protected]


Assuming integer types are 2's complement, the attached code appears to have
well-defined behavior.  If I am misunderstanding something about C arithmetic
then I apologize profusely for wasting peoples' time.  The source should be
small enough that someone can check this out relatively quickly.

With LLVM from recent svn on x86-32 I get the following:

[EMAIL PROTECTED] tmp1]$ llvm-gcc -O0 -fwrapv small.c ; ./a.out 
foo
[EMAIL PROTECTED] tmp1]$ llvm-gcc -O1 -fwrapv small.c ; ./a.out 
bar

For what it's worth "foo" is what gcc prints at all optimization levels.


-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to