Patchwork [PR49888,VTA] don't keep VALUEs bound to modified MEMs

login
register
mail settings
Submitter Alexandre Oliva
Date June 22, 2012, 1:58 a.m.
Message ID <ory5ngxg42.fsf@livre.localdomain>
Download mbox | patch
Permalink /patch/166460/
State New
Headers show

Comments

Alexandre Oliva - June 22, 2012, 1:58 a.m.
Here's one more patch that addresses a problem I found out while
investigating the PR53671 regressions: rather than recording incoming
stack args as MEMs with non-VALUE expressions, it's more consistent (and
less surprising) if we emit them as VALUE expressions, like other MEMs.

Regstrapped on x86_64-linux-gnu and i686-linux-gnu.  Ok?
Jakub Jelinek - June 22, 2012, 8:07 a.m.
On Thu, Jun 21, 2012 at 10:58:05PM -0300, Alexandre Oliva wrote:
> for  gcc/ChangeLog
> from  Alexandre Oliva  <aoliva@redhat.com>
> 
> 	* var-tracking.c (vt_add_function_parameter): Use a preserved
> 	VALUE for the MEM address of an incoming parameter.

Okay.

	Jakub

Patch

for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* var-tracking.c (vt_add_function_parameter): Use a preserved
	VALUE for the MEM address of an incoming parameter.

Index: gcc/var-tracking.c
===================================================================
--- gcc/var-tracking.c.orig	2012-06-21 22:26:01.341145372 -0300
+++ gcc/var-tracking.c	2012-06-21 22:26:09.644487877 -0300
@@ -9454,6 +9454,17 @@  vt_add_function_parameter (tree parm)
 			     VAR_INIT_STATUS_INITIALIZED, NULL, INSERT);
 	  dv = dv_from_value (val->val_rtx);
 	}
+
+      if (MEM_P (incoming))
+	{
+	  val = cselib_lookup_from_insn (XEXP (incoming, 0), mode, true,
+					 VOIDmode, get_insns ());
+	  if (val)
+	    {
+	      preserve_value (val);
+	      incoming = replace_equiv_address_nv (incoming, val->val_rtx);
+	    }
+	}
     }
 
   if (REG_P (incoming))