[patch RFC] Fix bogus RTL sharing error

Kaz Kojima kkojima@rr.iij4u.or.jp
Thu Nov 30 03:36:00 GMT 2006


Ian Lance Taylor <iant@google.com> wrote:
> OK, but don't test INSN_P (q).  It should always be true.  You can
> make it a gcc_assert if you like.

Thanks for your suggestions.  I've checked the attached
patch in.  It's tested with bootstrap and "make -k check"
on i686-pc-linux-gnu with no new failures.

Regards,
	kaz
--
2006-11-30  Kaz Kojima  <kkojima@gcc.gnu.org>

	* emit-rtl.c (verify_rtl_sharing): Handle SEQUENCE specially
	when clearing the used flags.

diff -uprN ORIG/trunk/gcc/emit-rtl.c LOCAL/trunk/gcc/emit-rtl.c
--- ORIG/trunk/gcc/emit-rtl.c	2006-11-12 20:14:34.000000000 +0900
+++ LOCAL/trunk/gcc/emit-rtl.c	2006-11-30 06:37:56.000000000 +0900
@@ -2292,6 +2292,20 @@ verify_rtl_sharing (void)
 	reset_used_flags (PATTERN (p));
 	reset_used_flags (REG_NOTES (p));
 	reset_used_flags (LOG_LINKS (p));
+	if (GET_CODE (PATTERN (p)) == SEQUENCE)
+	  {
+	    int i;
+	    rtx q, sequence = PATTERN (p);
+
+	    for (i = 0; i < XVECLEN (sequence, 0); i++)
+	      {
+		q = XVECEXP (sequence, 0, i);
+		gcc_assert (INSN_P (q));
+		reset_used_flags (PATTERN (q));
+		reset_used_flags (REG_NOTES (q));
+		reset_used_flags (LOG_LINKS (q));
+	      }
+	  }
       }
 
   for (p = get_insns (); p; p = NEXT_INSN (p))



More information about the Gcc-patches mailing list