https://llvm.org/bugs/show_bug.cgi?id=25552

            Bug ID: 25552
           Summary: extend -fwrapv to apply to left shifts
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: bonz...@gnu.org
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

If you pass clang -fwrapv then this causes -fsanitize=undefined to no longer
complain about signed integer overflows from addition.  However the sanitizer
will still complain about left shifts of negative values.

-fwrapv should apply also to shifts.  In addition -fwrapv in clang should
suppress -Wshift-negative-value.

(The GCC manuals only mention -fwrapv to affect add/sub/mult because GCC
currently _never_ treats signed left shifts as having undefined behavior.  GCC
documentation however says very clearly, under -fstrict-overflow, that "Using
'-fwrapv' means that integer signed overflow is fully defined: it wraps").

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to