Commit dcba59a
ext-dce: fix off-by-one in subreg liveness for 32-bit modes
ext_dce_process_uses uses `size >= 32` to decide whether group 3
(bits 32-63) is live for a lowpart subreg source. For SImode subregs
(size == 32), this incorrectly marks bits 32-63 as live, preventing
the pass from recognizing that the upper half of a DImode register is
dead. This blocks lw -> lwu narrowing on RV64.
Change the condition to `size > 32`, consistent with the other
thresholds in the same block (size > 8, size > 16). The size > 32
case is still reachable via SUBREG_PROMOTED_VAR_P which widens size
beyond the outer mode.
gcc/ChangeLog:
* ext-dce.cc (ext_dce_process_uses): Fix off-by-one: use
size > 32 instead of size >= 32 for group 3 liveness.
Co-authored-by: Konstantinos Eleftheriou <konstantinos.eleftheriou@vrull.eu>1 parent e6c1179 commit dcba59a
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1353 | 1353 | | |
1354 | 1354 | | |
1355 | 1355 | | |
1356 | | - | |
| 1356 | + | |
1357 | 1357 | | |
1358 | 1358 | | |
1359 | 1359 | | |
| |||
0 commit comments