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: [PATCH]: Fix PR rtl-optimization/29841: cfgbuild.c: control_flow_insn_p () .


> The patch forces any insn that has a barrier after it be
> control_flow_insn_p thus making it impossible for barrier to appear
> inside basic block.  An example of such insn is
> (insn (trap_if (const_int 1))) on i586-pc-linux-gnu.

I'll commit the following once testing is complete.


	* cfgbuild.c (control_flow_insn_p): Return TRUE for unconditional
	trap instructions.


-- 
Eric Botcazou
Index: cfgbuild.c
===================================================================
--- cfgbuild.c	(revision 123843)
+++ cfgbuild.c	(working copy)
@@ -120,6 +120,11 @@ control_flow_insn_p (rtx insn)
 	      || can_throw_internal (insn));
 
     case INSN:
+      /* Treat trap instructions like noreturn calls (same provision).  */
+      if (GET_CODE (PATTERN (insn)) == TRAP_IF
+	  && XEXP (PATTERN (insn), 0) == const1_rtx)
+	return true;
+
       return (flag_non_call_exceptions && can_throw_internal (insn));
 
     case BARRIER:

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