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]

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


On 05/11/2015 04:10 PM, Eric Botcazou wrote:
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.
OK.

You might consider a comment in active_insn_p and emit_pattern_{after,before}_setloc so that if someone fixes active_insn_p, they'll know to fix emit_pattern_{after,before}_setloc. "FIXME" doesn't capture this interaction at all ;-)

jeff


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