Index: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp =================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp @@ -2077,7 +2077,7 @@ if (hasStackGuardSlotTLS(Subtarget.getTargetTriple())) { if (Subtarget.isTargetFuchsia()) { // defines MX_TLS_STACK_GUARD_OFFSET with this value. - return SegmentOffset(IRB, 0x10, 257); + return SegmentOffset(IRB, 0x10, getAddressSpace()); } else { // %fs:0x28, unless we're using a Kernel code model, in which case // it's %gs:0x28. gs:0x14 on i386. @@ -2142,7 +2142,7 @@ // Fuchsia is similar. if (Subtarget.isTargetFuchsia()) { // defines MX_TLS_UNSAFE_SP_OFFSET with this value. - return SegmentOffset(IRB, 0x18, 257); + return SegmentOffset(IRB, 0x18, getAddressSpace()); } return TargetLowering::getSafeStackPointerLocation(IRB);