This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Fix PR rtl-optimization/29841: cfgbuild.c: control_flow_insn_p () .
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Maxim Kuvyrkov <mkuvyrkov at ispras dot ru>
- Cc: gcc-patches at gcc dot gnu dot org, Jan Hubicka <jh at suse dot cz>
- Date: Tue, 17 Apr 2007 09:53:59 +0200
- Subject: Re: [PATCH]: Fix PR rtl-optimization/29841: cfgbuild.c: control_flow_insn_p () .
- References: <45AB3F32.4020808@ispras.ru>
> 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: