[PATCH] [CodeGen] Annotate signed shift lefts with NUW

David Majnemer david.majnemer at gmail.com
Wed Apr 8 09:42:43 PDT 2015


Hi rsmith, chandlerc, nlewycky, nicholas, sanjoy,

For signed shifts, Op1 << Op2 in C and C++ is UB if the result cannot be
represented in the equivalent unsigned type.  While a stronger statement
can be made for C, let's start small and say that a signed shift left
cannot shift out any one bits.

http://reviews.llvm.org/D8899

Files:
  include/clang/Driver/Options.td
  include/clang/Frontend/CodeGenOptions.def
  lib/CodeGen/CGExprScalar.cpp
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CodeGen/compound-type.c
  test/OpenMP/atomic_update_codegen.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8899.23426.patch
Type: text/x-patch
Size: 6020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150408/ffb4a2b3/attachment.bin>


More information about the cfe-commits mailing list