mirror of
git://c9x.me/qbe.git
synced 2026-04-05 18:09:47 +00:00
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.
This commit is contained in:
parent
efcb5465e5
commit
bb8de8c633
@ -24,7 +24,7 @@ imm(Con *c, int k, int64_t *pn)
|
|||||||
i = Iplo12;
|
i = Iplo12;
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
i = Inlo12;
|
i = Inlo12;
|
||||||
n = -n;
|
n = -(uint64_t)n;
|
||||||
}
|
}
|
||||||
*pn = n;
|
*pn = n;
|
||||||
if ((n & 0x000fff) == n)
|
if ((n & 0x000fff) == n)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user