/cherry-pick 86a60e7
This fix is critical to get the AVR backend working again. Without this fix, it's practically unusable because almost all branches have an off-by-one error (one word, 2 bytes). For more context, see #102436 and #102936.
CC @Patryk27