diff mbox series

[committed,PR,rtl-optimization/115877,2/n] Improve liveness computation for constant initialization

Message ID 2779f1f1-38c3-460b-84dd-9bc49b3f3367@gmail.com
State New
Headers show
Series [committed,PR,rtl-optimization/115877,2/n] Improve liveness computation for constant initialization | expand

Commit Message

Jeff Law July 21, 2024, 2:42 p.m. UTC
While debugging pr115877, I noticed we were failing to remove the 
destination register from LIVENOW bitmap when it was set to a constant 
value.  ie  (set (dest) (const_int)).  This was a trivial oversight in 
safe_for_live_propagation.

I don't have an example of this affecting code generation, but it 
certainly could.  More importantly, by making LIVENOW more accurate it's 
easier to debug when LIVENOW differs from expectations.

As with the prior patch this has been tested as part of a larger 
patchset with the crosses as well as individually on x86_64.

Pushing to the trunk,
Jeff
PR rtl-optimization/115877
gcc/
	* ext-dce.cc (safe_for_live_propagation): Handle RTX_CONST_OBJ.
diff mbox series

Patch

diff --git a/gcc/ext-dce.cc b/gcc/ext-dce.cc
index 6d4b8858ec6..cbecfc53dba 100644
--- a/gcc/ext-dce.cc
+++ b/gcc/ext-dce.cc
@@ -69,6 +69,7 @@  safe_for_live_propagation (rtx_code code)
   switch (GET_RTX_CLASS (code))
     {
       case RTX_OBJ:
+      case RTX_CONST_OBJ:
 	return true;
 
       case RTX_COMPARE: