fix-32-bit-unreg
authorDebian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>
Wed, 10 Apr 2024 11:24:01 +0000 (14:24 +0300)
committerIlias Tsitsimpis <iliastsi@debian.org>
Wed, 10 Apr 2024 11:24:01 +0000 (14:24 +0300)
commita3356cc5f5f18f16d43fa47d79e79291a2e0cdf5
tree424f2706170b574a8962b03f36cfd1e8e0d8d04e
parentf445116fab06c19253d48df6cae312598a98800c
fix-32-bit-unreg

commit 9194c9c066a31cbb7a49830e4b5e2454fd4af6ba
Author: Cheng Shao <terrorjack@type.dance>
Date:   Mon Jan 23 13:17:07 2023 +0000

    CmmToC: fix CmmRegOff for 64-bit register on a 32-bit target

    We used to print the offset value to a platform word sized integer.
    This is incorrect when the offset is negative (e.g. output of cmm
    constant folding) and the register is 64-bit but on a 32-bit target,
    and may lead to incorrect runtime result (e.g. #22607).

    The fix is simple: just treat it as a proper MO_Add, with the correct
    width info inferred from the register itself.

    Metric Increase:
        T12707
        T13379
        T4801
        T5321FD
        T5321Fun

    (cherry picked from commit d151546e59a50158f25c3df6728b00d3c27bb4b9)

Gbp-Pq: Name fix-32-bit-unreg
compiler/GHC/CmmToC.hs