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]

[VTA] merge fwprop fix and revert vta workaround


I'd worked around a problem in fwprop in the VTA branch.  This was
obviated by Andy Hutchingson's patch that went into the trunk, so I
reverted the work-around and adjusted the patch along with the merge.

This is what I'm installing in the vta branch.

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

	* fwprop.c (forward_propagate_and_simplify): Replace entire
	var location rtx.  Revert part of 2007-11-08 obviated by:
	2008-04-02  Andy Hutchinson <hutchinsonamdy@aim.com>
	PR rtl-optimization/35542
	* fwprop.c (forward_propagate_and_simplify): Replace
	loc_reg_mentioned_in_p with reg_mentioned_p.

Index: gcc/fwprop.c
===================================================================
--- gcc/fwprop.c.orig	2008-02-19 05:41:38.000000000 -0300
+++ gcc/fwprop.c	2008-04-22 21:49:04.000000000 -0300
@@ -859,15 +859,8 @@ forward_propagate_and_simplify (struct d
     }
   else if (!use_set)
     {
-      loc = DF_REF_LOC (use);
+      loc = &INSN_VAR_LOCATION_LOC (use_insn);
       set_reg_equal = false;
-
-      if (GET_MODE (reg) != GET_MODE (src))
-	{
-	  gcc_assert (GET_CODE (src) == CONST_INT
-		      || GET_CODE (src) == CONST_DOUBLE);
-	  src = gen_rtx_CONST (GET_MODE (reg), src);
-	}
     }
   else
     {
@@ -894,6 +887,9 @@ forward_propagate_and_simplify (struct d
   if (!new)
     return false;
 
+  if (mode != GET_MODE (new))
+    new = wrap_constant (mode, new);
+
   return try_fwprop_subst (use, loc, new, def_insn, set_reg_equal);
 }
 
@@ -936,7 +932,7 @@ forward_propagate_into (struct df_ref *u
   else
     parent = PATTERN (use_insn);
 
-  if (!loc_mentioned_in_p (DF_REF_LOC (use), parent))
+  if (!reg_mentioned_p (DF_REF_REG (use), parent))
     return;
 
   def_insn = DF_REF_INSN (def);
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member       ÂSÃ Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}

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