aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorRobin Morisset <morisset@google.com>2014-10-07 23:53:57 +0000
committerRobin Morisset <morisset@google.com>2014-10-07 23:53:57 +0000
commit880580b88f9deed575104168e85f242401f8a92e (patch)
treed8f8e2f2a3e94cdae99b46da55d905c244835e10 /clang/lib/CodeGen/CodeGenModule.cpp
parent845bb3c2fdf4a370c706165f62804eff82f3e88d (diff)
downloadllvm-880580b88f9deed575104168e85f242401f8a92e.zip
llvm-880580b88f9deed575104168e85f242401f8a92e.tar.gz
llvm-880580b88f9deed575104168e85f242401f8a92e.tar.bz2
[X86] Fix a bug with fetch_add(INT32_MIN)
Summary: Fix pr21099 The pseudocode of what we were doing (spread through two functions) was: if (operand.doesNotFitIn32Bits()) Opc.initializeWithFoo(); if (operand < 0) operand = -operand; if (operand.doesFitIn8Bits()) Opc.initializeWithBar(); else if (operand.doesFitIn32Bits()) Opc.initializeWithBlah(); doStuff(Opc); So for operand == INT32_MIN, Opc was never initialized because the operand changes from fitting in 32 bits to not fitting, causing the various bugs/error messages noted by pr21099. This patch adds an extra test at the beginning for this case, and an llvm_unreachable to have better error message if the operand ends up not fitting in 32-bits at the end. Test Plan: new test + make check Reviewers: jfb Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5655 llvm-svn: 219257
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions