From patchwork Thu Feb 7 13:46:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 218930 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 F3D992C007C for ; Fri, 8 Feb 2013 00:47:15 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1360849637; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=EGP401CSQV4eV4IYiTcY VlJtuh0=; b=aCYjEZQq2W8Cjfv8tr0MRoxNe5FMgWUUECCR8OF/rvbwX5dTVkZA r3cWQ7oUEfik7+6XiuH4FZ8gPUE45gj1r7IbMyan4uOOeEMHyJGXguS3YEkMvBRL ohFSbZflMiCDZ2wUFmnv21D3wNbguFQ04C0GS4l41WjvT3cAPWlBP9Y= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=uOuiq6xI7ZmUYNn5wWaZlvRVp7gmxGgaTws8LKfKcDRKHZdKG8+oGj/2ZwgCak +mU4WAFYKjMw+j7lKS39ni7gj1+Sd4746X9JR1xn6sNr4Fs4nRuE5ktVSZtJ08qc oOthZHci6OUw34FWF6u9jFv68gm0e8l0PetBCiJQhkFdc=; Received: (qmail 19618 invoked by alias); 7 Feb 2013 13:46:49 -0000 Received: (qmail 19550 invoked by uid 22791); 7 Feb 2013 13:46:48 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Feb 2013 13:46:43 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r17Dkgce003912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Feb 2013 08:46:42 -0500 Received: from redhat.com (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r17DkcUb030772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 7 Feb 2013 08:46:41 -0500 Date: Thu, 7 Feb 2013 14:46:38 +0100 From: Marek Polacek To: Richard Biener Cc: GCC Patches Subject: Re: [PATCH] Check headers in verify_loop_structure Message-ID: <20130207134638.GI7360@redhat.com> References: <20130206184651.GH7360@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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 On Thu, Feb 07, 2013 at 10:14:14AM +0100, Richard Biener wrote: > I'd say "loop with header %d not in loop tree" here. Eventually > the header detection should be shared with the code in flow_loops_find > to avoid divergence. I'm making changes to the flow_loops_find code > at the moment and will look at splitting out that part properly to > be re-used by the verifier. Ok, thanks. This version, on top of your PR56181 fix, uses bb_loop_header_p then. Regtested/bootstrapped on x86_64-linux, ok for trunk after you commit your patch? Maybe I should try bootstrap-O3 on it as well... 2013-02-07 Marek Polacek * cfgloop.c (verify_loop_structure): Add more checking of headers. Marek --- gcc/cfgloop.c.mp 2013-02-07 14:07:24.580864372 +0100 +++ gcc/cfgloop.c 2013-02-07 14:11:42.005604064 +0100 @@ -1353,6 +1353,21 @@ verify_loop_structure (void) } } + /* Check the headers. */ + FOR_EACH_BB (bb) + { + /* Skip BBs in the root tree. */ + if (bb->loop_father == current_loops->tree_root) + continue; + + if (bb_loop_header_p (bb)) + if (bb->loop_father->header != bb) + { + error ("loop with header %d not in loop tree", bb->index); + err = 1; + } + } + /* Check get_loop_body. */ visited = sbitmap_alloc (last_basic_block); bitmap_clear (visited);