From patchwork Mon Sep 5 08:29:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 113321 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DA9C0B6F70 for ; Mon, 5 Sep 2011 18:30:40 +1000 (EST) Received: (qmail 14642 invoked by alias); 5 Sep 2011 08:30:35 -0000 Received: (qmail 14627 invoked by uid 22791); 5 Sep 2011 08:30:32 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_FAIL X-Spam-Check-By: sourceware.org Received: from smtp-vbr13.xs4all.nl (HELO smtp-vbr13.xs4all.nl) (194.109.24.33) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Sep 2011 08:30:18 +0000 Received: from [192.168.1.68] (teejay.xs4all.nl [213.84.119.160]) (authenticated bits=0) by smtp-vbr13.xs4all.nl (8.13.8/8.13.8) with ESMTP id p858TqfM055908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 5 Sep 2011 10:29:56 +0200 (CEST) (envelope-from vries@codesourcery.com) Message-ID: <4E64885E.7040406@codesourcery.com> Date: Mon, 05 Sep 2011 10:29:18 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13 MIME-Version: 1.0 To: Eric Botcazou CC: "gcc-patches@gcc.gnu.org" Subject: rtl_verify_flow_info fix Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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))