[LLVMbugs] [Bug 7853] New: unable to build a simple C program with -ftrapv

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 9 12:48:57 PDT 2010


           Summary: unable to build a simple C program with -ftrapv
           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: peterlee at cs.utah.edu
                CC: llvmbugs at cs.uiuc.edu

Hi There

This reduced code comes from a bigger program which is unable to build when
-ftrapv option is turned on.

There might be something wrong with the llvm.sadd.with.overflow intrinsic
checks on X64-32. 

This code can be built without any optimization, but would crash with -O1, -O2,
-O3 and -Os.

The command we used to build this program is "clang -O1 -ftrapv -c testTrapv.c"

And the program is shown as follows:

peterlee at bethe:/uusoc/res/embed/users/pengl/test$ cat testTrapv.c
foo(int flags)
    0 + (flags >> 8);



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