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]

Fix RTL checking failure in emit_pattern_{after|before}_setloc


This fixes an RTL checking failure I ran into while working on a change and it 
is latent in the pristine compiler.  emit_pattern_{after|before}_setloc have:

  if (active_insn_p (after) && !INSN_LOCATION (after))

  if (active_insn_p (first) && !INSN_LOCATION (first))

Now active_insn_p still has the FIXME:

int
active_insn_p (const_rtx insn)
{
  return (CALL_P (insn) || JUMP_P (insn)
	  || JUMP_TABLE_DATA_P (insn) /* FIXME */
	  || (NONJUMP_INSN_P (insn)
	      && (! reload_completed
		  || (GET_CODE (PATTERN (insn)) != USE
		      && GET_CODE (PATTERN (insn)) != CLOBBER))));
}

so if AFTER or FIRST are JUMP_TABLE_DATA_P, INSN_LOCATION is invoked on them 
and this triggers the RTL checking failure.

Fixed thusly, tested on x86_64-suse-linux, applied on the mainline.


2015-05-11  Eric Botcazou  <ebotcazou@adacore.com>

	* emit-rtl.c (emit_pattern_after_setloc): Add missing guard.
	(emit_pattern_before_setloc): Likewise.


-- 
Eric Botcazou
Index: emit-rtl.c
===================================================================
--- emit-rtl.c	(revision 222673)
+++ emit-rtl.c	(working copy)
@@ -4680,7 +4680,9 @@ emit_pattern_after_setloc (rtx pattern,
   after = NEXT_INSN (after);
   while (1)
     {
-      if (active_insn_p (after) && !INSN_LOCATION (after))
+      if (active_insn_p (after)
+	  && !JUMP_TABLE_DATA_P (after) /* FIXME */
+	  && !INSN_LOCATION (after))
 	INSN_LOCATION (after) = loc;
       if (after == last)
 	break;
@@ -4791,7 +4793,9 @@ emit_pattern_before_setloc (rtx pattern,
     first = NEXT_INSN (first);
   while (1)
     {
-      if (active_insn_p (first) && !INSN_LOCATION (first))
+      if (active_insn_p (first)
+	  && !JUMP_TABLE_DATA_P (first) /* FIXME */
+	  && !INSN_LOCATION (first))
 	INSN_LOCATION (first) = loc;
       if (first == last)
 	break;

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