Hello, In this PR, a set to a global reg is removed by fast-dce and ud-dce. Such sets should always be preserved.
The proposed fix is to make global regs always live. This is done in
the df-* parts of the patch from Jakub (the test case is also his).
In addition, ud-dce should consider sets of global regs inherently
necessary for DCE.
Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk?
Ciao!
Steven
gcc/
PR rtl-optimization/51447
* df-scan.c (df_get_entry_block_def_set): Add global regs to the set.
* df-problems.c (df_lr_local_compute): Make global regs always live.
PR rtl-optimization/51447
* dce.c (deletable_insn_p): Make insns setting a global reg
inherently necessary.
testsuite/
PR rtl-optimization/51447
* gcc.c-torture/execute/pr51447.c: New test.
PR51447.diff
Description: Binary data
