From patchwork Sun Sep 5 13:06:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 63827 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 4BBD7B7109 for ; Sun, 5 Sep 2010 23:06:27 +1000 (EST) Received: (qmail 1792 invoked by alias); 5 Sep 2010 13:06:24 -0000 Received: (qmail 1782 invoked by uid 22791); 5 Sep 2010 13:06:24 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS 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; Sun, 05 Sep 2010 13:06:19 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o85D6HE5024841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 5 Sep 2010 09:06:17 -0400 Received: from freie.oliva.athome.lsd.ic.unicamp.br (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o85D6Fj7029979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 5 Sep 2010 09:06:16 -0400 Received: from livre.localdomain (livre.oliva.athome.lsd.ic.unicamp.br [172.31.160.2]) by freie.oliva.athome.lsd.ic.unicamp.br (8.14.4/8.14.4) with ESMTP id o85D6EKY000641 for ; Sun, 5 Sep 2010 10:06:15 -0300 Received: from livre.localdomain (aoliva@localhost [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o85D6DaZ016305; Sun, 5 Sep 2010 10:06:13 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id o85D6CGL016303; Sun, 5 Sep 2010 10:06:12 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: [PR debug/45531] skip debug insns in cfglayout:fixup_reorder_chain Date: Sun, 05 Sep 2010 10:06:11 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 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 We don't hit this very often because debug insns aren't emitted without optimization unless explicitly requested, and with optimization this seems not to arise. Anyhow, it's easy enough to fix the code so that, even if it arises, we don't misbehave. Regstrapping on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog from Alexandre Oliva PR debug/45531 * cfglayout.c (fixup_reorder_chain): Skip debug insns. Index: gcc/cfglayout.c =================================================================== --- gcc/cfglayout.c.orig 2010-09-05 09:42:08.000000000 -0300 +++ gcc/cfglayout.c 2010-09-05 09:46:10.000000000 -0300 @@ -955,7 +955,7 @@ fixup_reorder_chain (void) insn = BB_END (e->src); end = PREV_INSN (BB_HEAD (e->src)); while (insn != end - && (!INSN_P (insn) || INSN_LOCATOR (insn) == 0)) + && (!NONDEBUG_INSN_P (insn) || INSN_LOCATOR (insn) == 0)) insn = PREV_INSN (insn); if (insn != end && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus)) @@ -970,7 +970,7 @@ fixup_reorder_chain (void) { insn = BB_HEAD (e->dest); end = NEXT_INSN (BB_END (e->dest)); - while (insn != end && !INSN_P (insn)) + while (insn != end && !NONDEBUG_INSN_P (insn)) insn = NEXT_INSN (insn); if (insn != end && INSN_LOCATOR (insn) && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus))