From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23628 invoked by alias); 31 Mar 2011 21:28:17 -0000 Received: (qmail 23614 invoked by uid 22791); 31 Mar 2011 21:28:15 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Thu, 31 Mar 2011 21:28:10 +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 p2VLS3Jq025787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 31 Mar 2011 17:28:03 -0400 Received: from anchor.twiddle.home (ovpn-113-141.phx2.redhat.com [10.3.113.141]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2VLS2JB001511; Thu, 31 Mar 2011 17:28:02 -0400 Message-ID: <4D94F1E2.8000906@redhat.com> Date: Thu, 31 Mar 2011 21:51:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 MIME-Version: 1.0 To: Bernd Schmidt CC: GCC Patches Subject: Re: [PATCH 3/6] Allow jumps in epilogues References: <4D8A0703.9090306@codesourcery.com> <4D8A089D.7020507@codesourcery.com> <4D8A23E8.4090802@redhat.com> <4D8A245A.20701@codesourcery.com> <4D8A2B86.4080402@redhat.com> <4D8CD227.5090205@codesourcery.com> <4D8D5CCC.10705@redhat.com> <4D94DD06.9030507@codesourcery.com> In-Reply-To: <4D94DD06.9030507@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2011-03/txt/msg02294.txt.bz2 On 03/31/2011 12:59 PM, Bernd Schmidt wrote: >> So long as late late compilation passes continue to not move frame-related >> insns across basic block boundaries, we should be fine. > > I'm nervous about this as the reorg pass can do arbitrary > transformations. On Blackfin for example, we can reorder basic blocks > for the sake of loop optimizations; sched-ebb can create new blocks, > etc. I think it would be best if we can somehow make it work during > final, without a CFG. I guess that's the best thing for now. I'm sure we all agree that long term all transformations should preserve the CFG all the way through final. At which point this could be implemented as a pass on the function after all transformations are complete. > Rather than use a CFG, I've tried to do something similar to > compute_barrier_args_size, using JUMP_LABELs etc. A reasonable solution for now, I suppose. > > Summary of the patches: > 001 - just create a dwarf2out_frame_debug_init function. Ok. > 002 - Make it walk the function in a first pass and record CFIs to > be output later Do I correctly understand that NOTE_INSN_CFI isn't actually being used in this patch? > 003 - Store dw_cfi_refs in VECs rather than linked lists. Looks > larger than it is due to reindentation Like 001, this one looks like it's totally independent of and of the other changes, and a good cleanup. Please go ahead and test and commit this one independently. > 004 - Change the function walk introduced in 002 so that it records > and restores state when reaching jumps/barriers I'm not too fond of vec_is_prefix_of. The Problem is that you're not applying any understanding of the actual data, just doing a string comparison (effectively). Imagine two code paths A and B that both save R2 and R3 into their respective stack slots. Imagine that -- for whatever reason -- the stores have been scheduled differently such that on path A R2 is saved before R3, and the reverse on path B. Your prefix test will conclude that paths A and B end with different unwind info, even though they are in fact compatible. Using some mechanism by which we can compare aggregate CFI information on a per-register basis ought to also vastly improve the efficiency in adjusting the cfi info between code points. It should also enable proper information in the -freorder-blocks-and-partition case. > * i386.c uses dwarf2out_frame_debug directly in some cases and is > unconverted Hum. I wonder what the best way to attack this. It's a local change, adjusting and then restoring the unwind state between two insns that should not be scheduled separately. We could turn them into two unspec_volatiles, and lose scheduling across this pattern. But ideally this is a value that ought to be shrink-wrapped. It's expensive to compute, and there are many early-return situations in which we don't need it. I suppose we could split this pattern manually in i386 reorg; forcing this to be split before final even at -O0. At that point all shrink-wrapping would be done and an unspecv replacement would be ok. > * I haven't tested whether my attempt to use > get_eh_landing_pad_from_rtx in the absence of a CFG actually works It will. This information is stored in cfun->eh. By design this information must survive until final, so that we can emit the actual eh info into the appropriate tables. > * Computed jumps and nonlocal gotos aren't handled. I think this > could be done by recording the state at NOTE_INSN_PROLOGUE_END > and using that for all labels we can't otherwise reach. That should be reasonable. You could assert that all of these labels are in forced_labels. All computed branch targets should be listed therein. r~