sparc64-fix-stack-alignment
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Tue, 13 Feb 2018 08:26:55 +0000 (08:26 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Tue, 13 Feb 2018 08:26:55 +0000 (08:26 +0000)
commit8e4aa276b58cf82769f3179960396fecf187535d
tree6adef7dac014255e7693e2ec00eb750cc35d271e
parentbe36fb1c42ad777e70e4e11711cb72c842ba7806
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