[LLVMbugs] [Bug 2271] New: bug?

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Apr 30 19:37:32 PDT 2008


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: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu


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:

[regehr at babel tmp1]$ llvm-gcc -O0 -fwrapv small.c ; ./a.out 
foo
[regehr at babel 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.



More information about the llvm-bugs mailing list