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]

[patch RFA] Fix PR rtl-optimization/37769


Hi,

PR 37769 is a 4.3/4.4 regression on SH which is an ice-on-valid-code:
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37769

In the failed case, the regmove pass changes the register for the memory
address which is post-inc'ed but doesn't update the associated REG_INC
note.
The attached patch is to update the REG_INC note in that case.
It's tested for i686-pc-linux-gnu (non AUTO_INC_DEC target) and for
powerpc-apple-darwin9.5.0 (AUTO_INC_DEC target) with bootstrap and
the top level "make -k check" with no new failures.
Ok for the trunk?

Regards,
	kaz
--
2008-10-13  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR rtl-optimization/37769
	* regmove.c (optimize_reg_copy_2): Update REG_INC note if needed.

--- ORIG/trunk/gcc/regmove.c	2008-08-26 22:05:15.000000000 +0900
+++ LOCAL/trunk/gcc/regmove.c	2008-10-09 10:14:06.000000000 +0900
@@ -686,6 +686,11 @@ optimize_reg_copy_2 (rtx insn, rtx dest,
 		if (reg_mentioned_p (dest, PATTERN (q)))
 		  {
 		    PATTERN (q) = replace_rtx (PATTERN (q), dest, src);
+		    if (FIND_REG_INC_NOTE (q, dest))
+		      {
+			remove_note (q, find_reg_note (q, REG_INC, dest));
+			add_reg_note (q, REG_INC, src);
+		      }
 		    df_insn_rescan (q);
 		  }
 


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