diff options
| author | Alexey Yerin <[email protected]> | 2024-08-02 14:39:07 +0300 |
|---|---|---|
| committer | Quentin Carbonneaux <[email protected]> | 2024-08-15 23:21:05 +0200 |
| commit | bb8de8c63362b7234db02482240d5600203225d9 (patch) | |
| tree | 5e5e9e6bca2ad8f4990efe2ae07986172438a5cc /arm64 | |
| parent | efcb5465e597571820391bee450dd1e8def300b4 (diff) | |
arm64/isel: Avoid signed overflow when handling immediates
Clang incorrectly optimizes this negation with -O2 and causes QBE to
emit 0 in place of INT64_MIN.
Diffstat (limited to 'arm64')
| -rw-r--r-- | arm64/isel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arm64/isel.c b/arm64/isel.c index 062beb3..9ce6adc 100644 --- a/arm64/isel.c +++ b/arm64/isel.c @@ -24,7 +24,7 @@ imm(Con *c, int k, int64_t *pn) i = Iplo12; if (n < 0) { i = Inlo12; - n = -n; + n = -(uint64_t)n; } *pn = n; if ((n & 0x000fff) == n) |
