Commit 7a60a962 authored by Keith Randall's avatar Keith Randall

cmd/compile: ecx is reserved for PIC, don't let peep work on it

Fixes #15496

Change-Id: Ieb5be1caa4b1c23e23b20d56c1a0a619032a9f5d
Reviewed-on: https://go-review.googlesource.com/22652Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
parent 58f52cbb
......@@ -249,6 +249,10 @@ func excise(r *gc.Flow) {
}
func regtyp(a *obj.Addr) bool {
if gc.Ctxt.Flag_shared && a.Type == obj.TYPE_REG && a.Reg == x86.REG_CX {
// don't propagate CX, it is used implicitly by PIC global references
return false
}
return a.Type == obj.TYPE_REG && (x86.REG_AX <= a.Reg && a.Reg <= x86.REG_DI || x86.REG_X0 <= a.Reg && a.Reg <= x86.REG_X7)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment