From patchwork Mon Oct 4 15:38:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Belevantsev X-Patchwork-Id: 66702 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 E318AB7214 for ; Tue, 5 Oct 2010 02:38:58 +1100 (EST) Received: (qmail 18624 invoked by alias); 4 Oct 2010 15:38:57 -0000 Received: (qmail 18615 invoked by uid 22791); 4 Oct 2010 15:38:56 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.198.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Oct 2010 15:38:51 +0000 Received: from [10.10.3.52] (winnie.ispras.ru [83.149.198.236]) by smtp.ispras.ru (Postfix) with ESMTP id C35F25D4089; Mon, 4 Oct 2010 19:37:50 +0400 (MSD) Message-ID: <4CA9F50A.6050409@ispras.ru> Date: Mon, 04 Oct 2010 19:38:50 +0400 From: Andrey Belevantsev User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0b7pre) Gecko/20101001 Thunderbird/3.3a1pre MIME-Version: 1.0 To: GCC Patches CC: Zdenek Dvorak Subject: 01/03: Bail out immediately with wrong dominance updates References: <4CA9F3DB.40700@ispras.ru> In-Reply-To: <4CA9F3DB.40700@ispras.ru> X-IsSubscribed: yes 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 Hello, This patch by Zdenek bails out immediately when a dominance update is performed on a control flow with unreachable basic blocks. Bootstrapped together with the other patches for 43603, ok for trunk? 2010-10-04 Zdenek Dvorak * et-forest.c (et_nca): Return NULL immediately when the dominance forest has disjoint components. diff --git a/gcc/et-forest.c b/gcc/et-forest.c index c15b6d8..94757c0 100644 --- a/gcc/et-forest.c +++ b/gcc/et-forest.c @@ -661,7 +661,7 @@ et_nca (struct et_node *n1, struct et_node *n2) if (r) r->parent = o1; } - else + else if (r == o2 || (r && r->parent != NULL)) { ret = o2->prev; @@ -669,6 +669,15 @@ et_nca (struct et_node *n1, struct et_node *n2) if (l) l->parent = o1; } + else + { + /* O1 and O2 are in different components of the forest. */ + if (l) + l->parent = o1; + if (r) + r->parent = o1; + return NULL; + } if (0 < o2->depth) {