sparc64-fix-stack-alignment
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Mon, 2 Jul 2018 08:45:18 +0000 (09:45 +0100)
committerJulien Cristau <jcristau@mozilla.com>
Mon, 2 Jul 2018 08:45:18 +0000 (09:45 +0100)
commite620f8d0d83f0de7dc1b35725647949b7c7eaad9
tree43369eba5c140816e7d3a620e041131e19cd94a2
parent652fa56689666bab03e2ddb767b12f8729660dc9
sparc64-fix-stack-alignment

 andn %sp,63,%sp

 This ensures (as intended) that the stack pointer has its low 6 bits
 cleared and is perfectly aligned on 64 bytes. Alas, this does not take
 Sparc64's stack pointer bias into account: The real register value is 2047
 (0x7ff) lower than the effective stack pointer address. As the stack an
 Sparc64 is always 8-byte aligned, the stack pointer register modulo 8 has
 to be 1.

 A crude fix to this is to not mask the lowest bit of the stack pointer
 (which will keep it 0 on Sparc32 and 1 on Sparc64), which I have verified
 to fix a Bus Error in rustc on Sparc64/Linux.
 .
 See: http://lists.llvm.org/pipermail/llvm-dev/2017-October/118620.html
Reported-By: Michael Karcher <debian@mkarcher.dialup.fu-berlin.de>
Author: James Clarke <jrtc27@jrtc27.com>

Gbp-Pq: Name sparc64-fix-stack-alignment.diff
lib/Target/Sparc/SparcFrameLowering.cpp