• David Crawshaw's avatar
    cmd/7g: fix ACMP entry in progtable · 33448d96
    David Crawshaw authored
    On arm64, CMP $foo, R is encoded as from=$foo, reg=R, not as from=$foo,
    to=R. The progtable entry for ACMP incorrectly described the latter
    form. Because of this, the registerizer was not accounting the registers
    used in CMP instructions and was incorrectly re-assigning those registers.
    
    This was an old problem, but it only became apparent after b115c35e
    (cmd/internal/gc: move cgen, regalloc, et al to portable code). Previous
    to this commit, the compiler used a slightly larger register set for the
    temps than it used for register variables. Since it had plenty registers
    dedicated to temps, the registers used in CMP instruction never clashed
    with registers assigned to register variables.
    
    Fixes #10253
    
    Change-Id: Iedf4bd882bd59440dff310ac0f81e0f53d80d7ed
    Reviewed-on: https://go-review.googlesource.com/8387Reviewed-by: 's avatarAram Hăvărneanu <aram@mgk.ro>
    Reviewed-by: 's avatarRob Pike <r@golang.org>
    Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    Reviewed-by: 's avatarMinux Ma <minux@golang.org>
    33448d96
issue10253.go 418 Bytes