This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] PR51477


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.

Attachment: PR51447.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]