From patchwork Fri Oct 1 22:24:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 66527 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 3DE2EB7124 for ; Sat, 2 Oct 2010 08:25:00 +1000 (EST) Received: (qmail 27611 invoked by alias); 1 Oct 2010 22:24:57 -0000 Received: (qmail 27596 invoked by uid 22791); 1 Oct 2010 22:24:56 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_CF, 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; Fri, 01 Oct 2010 22:24:50 +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 o91MOmCG015751 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 1 Oct 2010 18:24:49 -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 o91MOkoJ032382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 1 Oct 2010 18:24:48 -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 o91MOkfa017157 for ; Fri, 1 Oct 2010 19:24:46 -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 o91MOjCN023721; Fri, 1 Oct 2010 19:24:45 -0300 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id o91MOgNC023719; Fri, 1 Oct 2010 19:24:42 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: fix -fcompare-debug failure in libjava/javax/swing/plaf/basic Date: Fri, 01 Oct 2010 19:24:42 -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 The non-PIC compilation of libjava's javax/swing/plaf/basic.list fails -fcompare-debug on i686. The problem is that, at the end of one pass, we found debug insns referencing dead registers, and introduced new debug temps bound to the regs before they died. This marked the corresponding blocks as dirty except for LR, but this was not enough to avoid a cfgcleanup that moved insns around before the subsequent pass. Although this is a general problem, this specific problem occurred between DSE2 and CSA. The patch below pretty much reverts the patch for PR42889, and uses the same solution that I had used in other functions in df-scan.c: don't mark BBs as dirty at all when messing with debug insns only. Regstrapped on x86_64-linux-gnu and i686-pc-linux-gnu, for the first time in a long time with bootstrap-debug-libs in BOOT_CONFIG. FWIW, the earlier patch for pr42889 addded a testcase, and it still passed after this patch. Ok to install? for gcc/ChangeLog from Alexandre Oliva PR debug/42889 * df-scan.c (df_insn_rescan): Don't mark BBs upon debug insns. * df-core.c (df_set_bb_dirty_nonrl): Remove. * df.h (df_set_bb_dirty_nonlr): Likewise. Index: gcc/df-core.c =================================================================== --- gcc/df-core.c.orig 2010-09-29 00:31:22.793305711 -0300 +++ gcc/df-core.c 2010-09-29 00:31:59.102300960 -0300 @@ -1428,29 +1428,6 @@ df_set_bb_dirty (basic_block bb) } -/* Mark BB as needing it's transfer functions as being out of - date, except for LR problem. Used when analyzing DEBUG_INSNs, - as LR problem can trigger DCE, and DEBUG_INSNs shouldn't ever - shorten or enlarge lifetime of regs. */ - -void -df_set_bb_dirty_nonlr (basic_block bb) -{ - if (df) - { - int p; - for (p = 1; p < df->num_problems_defined; p++) - { - struct dataflow *dflow = df->problems_in_order[p]; - if (dflow == df_lr) - continue; - if (dflow->out_of_date_transfer_functions) - bitmap_set_bit (dflow->out_of_date_transfer_functions, bb->index); - dflow->solutions_dirty = true; - } - } -} - /* Grow the bb_info array. */ void Index: gcc/df-scan.c =================================================================== --- gcc/df-scan.c.orig 2010-09-29 00:31:22.416299239 -0300 +++ gcc/df-scan.c 2010-09-29 00:31:28.613295888 -0300 @@ -1261,9 +1261,7 @@ df_insn_rescan (rtx insn) } df_refs_add_to_chains (&collection_rec, bb, insn); - if (DEBUG_INSN_P (insn)) - df_set_bb_dirty_nonlr (bb); - else + if (!DEBUG_INSN_P (insn)) df_set_bb_dirty (bb); VEC_free (df_ref, stack, collection_rec.def_vec); Index: gcc/df.h =================================================================== --- gcc/df.h.orig 2010-09-29 00:31:23.239291180 -0300 +++ gcc/df.h 2010-09-29 00:33:02.552389137 -0300 @@ -897,7 +897,6 @@ extern void df_simple_dataflow (enum df_ extern void df_mark_solutions_dirty (void); extern bool df_get_bb_dirty (basic_block); extern void df_set_bb_dirty (basic_block); -extern void df_set_bb_dirty_nonlr (basic_block); extern void df_compact_blocks (void); extern void df_bb_replace (int, basic_block); extern void df_bb_delete (int);