From 488fd4e6255d6216f2a678d9ac6a184f4e449695 Mon Sep 17 00:00:00 2001 From: Strahinja Petrovic Date: Mon, 17 Sep 2018 11:03:40 +0000 Subject: [PowerPC] Fix label address calculation for ppc64 This patch fixes calculating address of label for non-pic ppc64. Differential Revision: https://reviews.llvm.org/D50965 llvm-svn: 342368 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target') diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 5dee7b12a21..dba69a160d4 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -2705,7 +2705,8 @@ SDValue PPCTargetLowering::LowerBlockAddress(SDValue Op, // 64-bit SVR4 ABI code is always position-independent. // The actual BlockAddress is stored in the TOC. - if (Subtarget.isSVR4ABI() && isPositionIndependent()) { + if (Subtarget.isSVR4ABI() && + (Subtarget.isPPC64() || isPositionIndependent())) { if (Subtarget.isPPC64()) setUsesTOCBasePtr(DAG); SDValue GA = DAG.getTargetBlockAddress(BA, PtrVT, BASDN->getOffset()); -- cgit v1.2.3