Fix crash in rtl verifier

Andreas Schwab
Fri Dec 12 12:31:00 GMT 2008

While hunting down another bug I experienced a crash in
rtl_verify_flow_info_1: a BARRIER insn doesn't have a bb pointer.
Although the crash does not happen any more with the specific test case
I used, this still looks obvious to me, so I checked it in.


2008-12-12  Andreas Schwab  <>

	* cfgrtl.c (rtl_verify_flow_info_1): Don't apply BLOCK_FOR_INSN on
	a BARRIER insn.

Index: cfgrtl.c
--- cfgrtl.c	(revision 142707)
+++ cfgrtl.c	(working copy)
@@ -1731,7 +1731,8 @@ rtl_verify_flow_info_1 (void)
       FOR_BB_INSNS (bb, insn)
-	if (BLOCK_FOR_INSN (insn) != bb)
+	if (!BARRIER_P (insn)
+	    && BLOCK_FOR_INSN (insn) != bb)
 	    error ("insn %d basic block pointer is %d, should be %d",
 		   INSN_UID (insn),

Andreas Schwab, SuSE Labs,
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

More information about the Gcc-patches mailing list