[patch committed] SH: Fix PR target/31022

Kaz Kojima kkojima@rr.iij4u.or.jp
Mon Mar 19 08:43:00 GMT 2007


The attached patch fixes PR target/31022

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31022

which is a 4.1/4.2/4.3 regression.
In the problematic case, sh_adjust_cost applied SET_DEST to
a parallel pattern.  The patch uses the result of single_set
instead of the pattern itself.  Bootstrapped and regtesed with
the top level "make -k check" on sh4-unknown-linux-gnu with
no new failures.  I've checked it in on the trunk.  I'll plan
to apply the backported patches to 4.1 and 4.2 branches after
tests, but now all my SH machines are devoted to the tests on
4.2 RC1.

Regards,
	kaz
--
2007-03-19  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR target/31022
	* config/sh/sh.c (sh_adjust_cost): Use the result of single_set
	instead of PATTERN.

--- ORIG/trunk/gcc/config/sh/sh.c	2007-03-10 16:04:12.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/sh.c	2007-03-15 08:43:32.000000000 +0900
@@ -8966,7 +8966,7 @@ sh_adjust_cost (rtx insn, rtx link ATTRI
 	     by 1 cycle.  */
 	  if (get_attr_type (insn) == TYPE_DYN_SHIFT
 	      && get_attr_any_int_load (dep_insn) == ANY_INT_LOAD_YES
-	      && reg_overlap_mentioned_p (SET_DEST (PATTERN (dep_insn)),
+	      && reg_overlap_mentioned_p (SET_DEST (dep_set),
 					  XEXP (SET_SRC (single_set (insn)),
 						1)))
 	    cost++;



More information about the Gcc-patches mailing list