From patchwork Wed Feb 5 15:41:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 317187 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A47932C0091 for ; Thu, 6 Feb 2014 02:42:01 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=Ba9FNjlG7l+ErCCgv 0VJIaD7LJJISajROZUzQlvya191aEQ+PWRKXFtmvHPE95Teia4zxnJTXYuz7qoAJ Nx5lVxfzs/0WaR4IhaII2sDmlmP43cmYJ6/2GUG6IC7MuVQiNlgPwyKT5GCs/UYC FvcolS0GaHsO8OQ93xkWHBYEgc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=JuOWMMU7REH5m5lSwUcfJth FCM8=; b=psrP4IBHgipoBQs3jEfU3bSYq8qumiSy0Qwkb/S4ZStq4GJHaKIpHit izwTlKIUYXOXVjhLrGBUyD/MkdogbVJRoiDb3Q77NXlRNlVzeqXg4hUBrsCDsmF5 /5heS1lZx95AwjsLs+490OVOXfWMXfdjZagtdDLdvJxuFPXfgK1c= Received: (qmail 31189 invoked by alias); 5 Feb 2014 15:41:55 -0000 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 Received: (qmail 31168 invoked by uid 89); 5 Feb 2014 15:41:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Feb 2014 15:41:52 +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.14.4/8.14.4) with ESMTP id s15FfnhW020003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Feb 2014 10:41:50 -0500 Received: from pike.twiddle.home (vpn-62-27.rdu2.redhat.com [10.10.62.27]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s15Ffh7B007425; Wed, 5 Feb 2014 10:41:45 -0500 Message-ID: <52F25BB6.3030003@redhat.com> Date: Wed, 05 Feb 2014 07:41:42 -0800 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Jan Hubicka , Jakub Jelinek , Vladimir Makarov Subject: Re: Fix bootstrap with -mno-accumulate-outgoing-args References: <20140101142311.GC26209@kam.mff.cuni.cz> <52F113EE.3010308@redhat.com> <20140204164851.GB9877@kam.mff.cuni.cz> <52F11DFE.1090503@redhat.com> <20140204173509.GA16580@kam.mff.cuni.cz> <52F25B6D.3020600@redhat.com> In-Reply-To: <52F25B6D.3020600@redhat.com> X-IsSubscribed: yes This time with the patch... On 02/05/2014 07:40 AM, Richard Henderson wrote: > On 02/04/2014 09:35 AM, Jan Hubicka wrote: >>> On 02/04/2014 08:48 AM, Jan Hubicka wrote: >>>> How things are supposed to work in this case? So perhaps we need scheduler to >>>> understand and move around the ARGS_SIZE note? >>> >>> I believe we do need to have the scheduler move the notes around. >> >> If we need notes on non-stack adjusting insns as you seem to show in your testcase, >> I guess it is the only way around. Still combine stack adjust may be smart enough >> to not produce redundant note in the case of go's ICE. >> >> I am not terribly familiar with the code, will you look into it or shall I give it a try? > > I had a brief look at find_modifiable_mems, which seems to be the only kind of > schedule-time dependency breaking that we do. I started writing some new code > that would handle REG_ARGS_SIZE, but then considered that wasn't terribly > appropriate for stage4. > > So I've left off with just the dependency links between the insns. We'd need > these for the schedule-time adjustments anyway, and with them in place the > scheduler does not re-order the insns in a way that causes problems. > > Testing for x86_64 has finished; i686 is nearly done. I suppose the only > question I have is if anyone disagrees that OUTPUT is incorrect as the > dependency type. > > > r~ > * combine-stack-adj.c: Revert r206943. * sched-int.h (struct deps_desc): Add last_args_size. * sched-deps.c (init_deps): Initialize it. (sched_analyze_insn): Add OUTPUT dependencies between insns that contain REG_ARGS_SIZE notes. diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c index c591c60..69fd5ea 100644 --- a/gcc/combine-stack-adj.c +++ b/gcc/combine-stack-adj.c @@ -567,7 +567,6 @@ combine_stack_adjustments_for_block (basic_block bb) && try_apply_stack_adjustment (insn, reflist, 0, -last_sp_adjust)) { - rtx note; if (last2_sp_set) maybe_move_args_size_note (last2_sp_set, last_sp_set, false); else @@ -577,11 +576,6 @@ combine_stack_adjustments_for_block (basic_block bb) reflist = NULL; last_sp_set = NULL_RTX; last_sp_adjust = 0; - /* We no longer adjust stack size. Whoever adjusted it earlier - hopefully got the note right. */ - note = find_reg_note (insn, REG_ARGS_SIZE, NULL_RTX); - if (note) - remove_note (insn, note); continue; } } diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 7efc937..efc4223 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -3470,6 +3470,15 @@ sched_analyze_insn (struct deps_desc *deps, rtx x, rtx insn) change_spec_dep_to_hard (sd_it); } } + + /* We do not yet have code to adjust REG_ARGS_SIZE, therefore we must + honor their original ordering. */ + if (find_reg_note (insn, REG_ARGS_SIZE, NULL)) + { + if (deps->last_args_size) + add_dependence (insn, deps->last_args_size, REG_DEP_OUTPUT); + deps->last_args_size = insn; + } } /* Return TRUE if INSN might not always return normally (e.g. call exit, @@ -3876,6 +3885,7 @@ init_deps (struct deps_desc *deps, bool lazy_reg_last) deps->sched_before_next_jump = 0; deps->in_post_call_group_p = not_post_call; deps->last_debug_insn = 0; + deps->last_args_size = 0; deps->last_reg_pending_barrier = NOT_A_BARRIER; deps->readonly = 0; } diff --git a/gcc/sched-int.h b/gcc/sched-int.h index 3b1106f..2cec624 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -539,6 +539,9 @@ struct deps_desc /* The last debug insn we've seen. */ rtx last_debug_insn; + /* The last insn bearing REG_ARGS_SIZE that we've seen. */ + rtx last_args_size; + /* The maximum register number for the following arrays. Before reload this is max_reg_num; after reload it is FIRST_PSEUDO_REGISTER. */ int max_reg;