From patchwork Wed Jan 19 22:23:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 79605 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 387D5B6EE9 for ; Thu, 20 Jan 2011 09:24:08 +1100 (EST) Received: (qmail 8792 invoked by alias); 19 Jan 2011 22:24:06 -0000 Received: (qmail 8761 invoked by uid 22791); 19 Jan 2011 22:24:05 -0000 X-SWARE-Spam-Status: No, hits=-5.5 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; Wed, 19 Jan 2011 22:24:00 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0JMNwHR019238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 19 Jan 2011 17:23:58 -0500 Received: from freie.oliva.athome.lsd.ic.unicamp.br (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p0JMNvVQ009877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 19 Jan 2011 17:23:58 -0500 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie.oliva.athome.lsd.ic.unicamp.br (8.14.4/8.14.4) with ESMTP id p0JMNukW015940 for ; Wed, 19 Jan 2011 20:23:56 -0200 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 p0JMNtmO024582; Wed, 19 Jan 2011 20:23:55 -0200 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id p0JMNt5l024580; Wed, 19 Jan 2011 20:23:55 -0200 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: Re: [PR debug/45454] restore sel-sched to non-crashing with VTA References: Date: Wed, 19 Jan 2011 20:23:54 -0200 In-Reply-To: (Alexandre Oliva's message of "Mon, 06 Sep 2010 14:22:12 -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 On Sep 6, 2010, Alexandre Oliva wrote: > Selective scheduling is used to cause codegen differences and debug > information corruption with VTA, so VTA is implicitly disabled on > platforms that enable selective scheduling. However, if you force it > on, you get a warning, and the compiler does its best. > Unfortunately, since we started tracking dependencies of non-debug insns > on debug insns, “its best” often turned out to be a crash, because > internal checking on whether an insn was available would find it to be > both available and unavailable. > This patch restores the earlier behavior, by which debug insns never > stop non-debug insns from being moved ahead of themselves. Ideally, > we'd reset or otherwise adjust the debug insn as we plan to move the > dependent insn ahead of it, but I couldn't figure out a simple way to do > that. > Since VTA is incompatible with sel-sched in other ways, I figured I'd > just fix the crash, and leave a note so that the problem is fixed > whenever someone who truly understands sel-sched comes up with a good > way to deal with debug insns. > Ok to install? Ping? for gcc/ChangeLog from Alexandre Oliva PR debug/45454 * sel-sched.c (moveup_expr): Don't let debug insns prevent non-debug insns from moving up. Index: gcc/sel-sched.c =================================================================== --- gcc/sel-sched.c.orig 2010-11-26 01:06:02.565820892 -0200 +++ gcc/sel-sched.c 2010-11-26 01:07:58.286593063 -0200 @@ -2141,6 +2141,15 @@ moveup_expr (expr_t expr, insn_t through ds_t *has_dep_p; ds_t full_ds; + /* ??? We use dependencies of non-debug insns on debug insns to + indicate that the debug insns need to be reset if the non-debug + insn is pulled ahead of it. It's hard to figure out how to + introduce such a notion in sel-sched, but it already fails to + support debug insns in other ways, so we just go ahead and + let the deug insns go corrupt for now. */ + if (DEBUG_INSN_P (through_insn) && !DEBUG_INSN_P (insn)) + return MOVEUP_EXPR_SAME; + /* When inside_insn_group, delegate to the helper. */ if (inside_insn_group) return moveup_expr_inside_insn_group (expr, through_insn);