From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32675 invoked by alias); 7 Sep 2012 21:50:15 -0000 Received: (qmail 32652 invoked by uid 22791); 7 Sep 2012 21:50:12 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD,TW_CF X-Spam-Check-By: sourceware.org Received: from dns1.mips.com (HELO dns1.mips.com) (12.201.5.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Sep 2012 21:49:56 +0000 Received: from mailgate1.mips.com (mailgate1.mips.com [12.201.5.111]) by dns1.mips.com (8.13.8/8.13.8) with ESMTP id q87LnpbC018871; Fri, 7 Sep 2012 14:49:52 -0700 X-M-MSG: Received: from exchdb01.mips.com (unknown [192.168.36.84]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mailgate1.mips.com (Postfix) with ESMTP id 28418364641; Fri, 7 Sep 2012 14:49:46 -0700 (PDT) Received: from [192.168.65.53] (192.168.65.53) by exchhub01.mips.com (192.168.36.84) with Microsoft SMTP Server id 14.1.270.1; Fri, 7 Sep 2012 14:49:41 -0700 Subject: Re: [Patch, PR 54128] ira.c change to fix mips bootstrap From: Steve Ellcey To: Jakub Jelinek CC: In-Reply-To: <20120905061507.GD1999@tucnak.redhat.com> References: <20120905061507.GD1999@tucnak.redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 07 Sep 2012 21:50:00 -0000 Message-ID: <1347054581.14333.275.camel@ubuntu-sellcey> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: 66zN5dDQUtqR5SE1cbs7mA== Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-09/txt/msg00506.txt.bz2 On Wed, 2012-09-05 at 08:15 +0200, Jakub Jelinek wrote: > On Fri, Aug 31, 2012 at 10:58:51AM -0700, Steve Ellcey wrote: > > Here is my patch to fix the bootstrap comparision failure (PR 54128) on > > MIPS. The reason for the comparision failure was a difference in > > register usage and I tracked it down to build_insn_chain which checked > > all instructions for register usage in order to set the dead_or_set > > and live_relevant_regs bitmaps instead of checking only non-debug > > instructions. Changing INSN_P to NONDEBUG_INSN_P in build_insn_chain > > allowed me to bootstrap and caused no regressions. > > The debug insns generally shouldn't extend the lifetime of pseudos (see the > valtrack.c stuff), so if you hit this, there is probably some earlier bug > that didn't reset/adjust the debug insns in question. > I'm not saying the ira.c patch is absolutely a bad idea, but it would be > good if you could investigate where those debug insns started extending > lifetime of pseudos. > > > 2012-08-31 Steve Ellcey > > > > PR bootstrap/54128 > > * ira.c (build_insn_chain): Check only NONDEBUG instructions for > > register usage. > > Jakub I think I know where this may be going wrong, though I am having trouble actually creating a patch. I think MIPS should define TARGET_DELAY_VARTRACK and call variable_tracking_main from mips_reorg. The systems that define TARGET_DELAY_VARTRACK all have this comment: /* Variable tracking should be run after all optimizations which change order of insns. It also needs a valid CFG. */ #undef TARGET_DELAY_VARTRACK #define TARGET_DELAY_VARTRACK true And I think mips_reorg could change the order of insns. I have tried putting a call to variable_tracking_main in mips_df_reorg (and changed mips_cfg_in_reorg to return true if flag_var_tracking is true but that didn't fix the problem. I thought this might be because some of the mips_reorg code that comes after mips_df_reorg is still changing insn ordering. I tried putting a call to variable_tracking_main at the end of mips_reorg: if (flag_var_tracking) { compute_bb_for_insn (); df_analyze (); timevar_push (TV_VAR_TRACKING); variable_tracking_main (); timevar_pop (TV_VAR_TRACKING); df_finish_pass (false); free_bb_for_insn (); } But I just get a seg fault in compute_bb_for_insn, If I remove that (and free_bb_for_insn) I get a segfault in df_analyze. I am not sure exactly what I need to set up to call variable_tracking_main at this point in the code. Is there something else I need to call to ensure that I have a valid control flow graph? I don't see other platforms that call variable_tracking_main from their reorg routines doing anything else. Steve Ellcey sellcey@mips.com