From: Bruno Cardoso Lopes Date: Thu, 4 Dec 2014 20:36:06 +0000 (+0000) Subject: [x86] Fix isOffsetSuitableForCodeModel kernel code model offset X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9eb2a386c77247f068f02dea67f67d8b2a39ac6c;p=oota-llvm.git [x86] Fix isOffsetSuitableForCodeModel kernel code model offset Offset == 0 is a valid offset for kernel code model according to the x86_64 System V ABI. Found by inspection, no testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223383 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 8c66e97d75f..7976d33397e 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -3673,7 +3673,7 @@ bool X86::isOffsetSuitableForCodeModel(int64_t Offset, CodeModel::Model M, // For kernel code model we know that all object resist in the negative half // of 32bits address space. We may not accept negative offsets, since they may // be just off and we may accept pretty large positive ones. - if (M == CodeModel::Kernel && Offset > 0) + if (M == CodeModel::Kernel && Offset >= 0) return true; return false;