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]

Re: [PATCH] PR/34012, fwprop does not look at rtx_costs



The middle-end changes also make sense to me.  So, this is ok if there's
no override from someone else in the next 24h.

This alternative patch fixes the failure, and also PR34067. It makes no sense to check rtx_cost if fwprop was doing addressing mode selection. Bootstrap/regtest in progress, ok if it passes?


I'll consider reposting the other changes for 4.4.

Paolo
2007-11-14  Paolo Bonzini  <bonzini@gnu.org>

	* fwprop.c (try_fwprop_subst): Skip profitability check for forward
	propagation into an address; that's done in should_replace_address.

Index: fwprop.c
===================================================================
--- fwprop.c	(revision 130070)
+++ fwprop.c	(working copy)
@@ -697,7 +697,8 @@ try_fwprop_subst (struct df_ref *use, rt
       ok = false;
     }
 
-  else if (rtx_cost (SET_SRC (set), SET) > old_cost)
+  else if (DF_REF_TYPE (use) == DF_REF_REG_USE
+	   && rtx_cost (SET_SRC (set), SET) > old_cost)
     {
       if (dump_file)
 	fprintf (dump_file, "Changes to insn %d not profitable\n",

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