This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
rtl_verify_flow_info fix
- From: Tom de Vries <vries at codesourcery dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 05 Sep 2011 10:29:18 +0200
- Subject: rtl_verify_flow_info fix
Hi Eric,
During testing the approved-for-commit middle-end patch for bug 43864 on ARM, I
ran into a gcc.dg/torture/pr46068.c ICE.
An asm jump is not recognized as an unconditional jump, so its followed by a
fall-through block rather than a barrier.
...
(jump_insn 10 9 19 4 (asm_operands/v ("") ("") 0 []
[]
[
(label_ref:SI 16)
] pr46068.c:16) pr46068.c:6 -1
(nil)
-> 16)
...
ce3 then turns the asm jump into an asm return, still without a barrier after it:
...
(jump_insn 10 9 19 4 (asm_operands/v ("") ("") 0 []
[]
[
(return)
] pr46068.c:16) pr46068.c:6 -1
(nil)
-> return)
...
This triggers the cfgrtl.c assert:
...
if (JUMP_P (x)
&& returnjump_p (x) && ! condjump_p (x)
&& ! (next_nonnote_insn (x) && BARRIER_P (next_nonnote_insn (x))))
fatal_insn ("return not followed by barrier", x);
...
The patch fixes the assert by replacing ! condjump_p with uncondjump_p.
Bootstrapped and reg-tested on arm and x86_64.
OK for trunk?
Thanks,
- Tom
2011-09-05 Tom de Vries <tom@codesourcery.com>
* cfgrtl.c (rtl_verify_flow_info): Use any_uncondjump_p instead of
!condjump_p.
Index: gcc/cfgrtl.c
===================================================================
--- gcc/cfgrtl.c (revision 178056)
+++ gcc/cfgrtl.c (working copy)
@@ -2169,7 +2169,7 @@ rtl_verify_flow_info (void)
}
if (JUMP_P (x)
- && returnjump_p (x) && ! condjump_p (x)
+ && returnjump_p (x) && any_uncondjump_p (x)
&& ! (next_nonnote_insn (x) && BARRIER_P (next_nonnote_insn (x))))
fatal_insn ("return not followed by barrier", x);
if (curr_bb && x == BB_END (curr_bb))