This is the mail archive of the gcc-bugs@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: Re: ICE in 920624-1.c with -O3 -funroll-loops on vax-dec-ultrix4.3


> The ICE occurs in verify_flow_info when it encounters a barrier.  It appears
> that case insn's are being incorrectly simplified in the cse2 pass.  This
> is the rtl from loop:

The ICE occurs because the original conditional jump gets converted to
an unconditional jump and a barrier is added after the jump.  However,
the jump table data still remains in the rtl for the block.  This
confuses the edge analysis into thinking that the block falls thru
and we have an inconsistent configuration.

This patch fixes the problem by deleting the jump table data when a
conditional or computed jump is converted to an unconditional jump.
I have verified that the patch fixes the original problem observed
under vax-dec-ultrix4.3.  A new vax bootstrap is underway but it
won't finish until sometime next month.

Bootstrap checked with no regressions on i686-pc-linux-gnu and
hppa2.0w-hp-hpux11.11.

OK to install?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2002-01-14  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* cse.c (cse_insn): Delete jump table data when a conditional or
	computed jump is converted to an unconditional jump.

--- cse.c.orig	Mon Jan 14 12:24:57 2002
+++ cse.c	Mon Jan 14 17:48:32 2002
@@ -5767,9 +5767,19 @@
 	 be a conditional or computed branch.  */
       else if (dest == pc_rtx && GET_CODE (src) == LABEL_REF)
 	{
-	  /* Now emit a BARRIER after the unconditional jump.  */
-	  if (NEXT_INSN (insn) == 0
-	      || GET_CODE (NEXT_INSN (insn)) != BARRIER)
+	  rtx next = NEXT_INSN (insn);
+	  rtx tmp;
+
+	  /* Delete jump table data if present.  */
+	  if (next != NULL_RTX
+	      && LABEL_P (next)
+	      && (tmp = NEXT_INSN (next)) != NULL_RTX
+	      && JUMP_TABLE_DATA_P (tmp))
+	    delete_insn (tmp);
+
+	  /*  Now emit a BARRIER after the unconditional jump.  */
+	  if (next == NULL_RTX
+	      || GET_CODE (next) != BARRIER)
 	    emit_barrier_after (insn);
 
 	  /* We reemit the jump in as many cases as possible just in


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