summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC
diff options
context:
space:
mode:
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>2018-02-16 14:49:01 +0000
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2018-02-16 14:49:01 +0000
commit6cf41b028d5deaee192d8e9195af2b9a80dea3ed (patch)
treed7965ffd04a4c18138be76c9b5fd0ce2d004eaf7 /llvm/lib/Target/PowerPC
parente44533b7f1014e17a87ae2e5e75fae8a2e0228fd (diff)
downloadbcm5719-llvm-6cf41b028d5deaee192d8e9195af2b9a80dea3ed.tar.gz
bcm5719-llvm-6cf41b028d5deaee192d8e9195af2b9a80dea3ed.zip
[PowerPC] Fix transform in table gen file causing UB
Running a bootstrap build with UBSan produces a number of instances where we have signed integer overflow due to this transform. Change the type to long to prevent this UB on 64-bit build machines. llvm-svn: 325347
Diffstat (limited to 'llvm/lib/Target/PowerPC')
-rw-r--r--llvm/lib/Target/PowerPC/PPCInstrInfo.td2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
index 43dcc4479cf..d51a0e508ce 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
@@ -308,7 +308,7 @@ def HI16 : SDNodeXForm<imm, [{
def HA16 : SDNodeXForm<imm, [{
// Transformation function: shift the immediate value down into the low bits.
- int Val = N->getZExtValue();
+ long Val = N->getZExtValue();
return getI32Imm((Val - (signed short)Val) >> 16, SDLoc(N));
}]>;
def MB : SDNodeXForm<imm, [{
OpenPOWER on IntegriCloud