From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106569 invoked by alias); 19 Jul 2017 14:04:55 -0000 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 Received: (qmail 106549 invoked by uid 89); 19 Jul 2017 14:04:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1862 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Jul 2017 14:04:52 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 368D8AAB9; Wed, 19 Jul 2017 14:04:49 +0000 (UTC) Date: Wed, 19 Jul 2017 14:04:00 -0000 From: Richard Biener To: Jan Hubicka cc: gcc-patches@gcc.gnu.org Subject: Re: Fix Eh delivery in partitioned functions In-Reply-To: <20170719140043.GC38394@kam.mff.cuni.cz> Message-ID: References: <20170718072624.GA52973@kam.mff.cuni.cz> <20170718074423.GA7463@kam.mff.cuni.cz> <20170719125211.GA53494@kam.mff.cuni.cz> <20170719140043.GC38394@kam.mff.cuni.cz> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2017-07/txt/msg01156.txt.bz2 On Wed, 19 Jul 2017, Jan Hubicka wrote: > > On Wed, 19 Jul 2017, Jan Hubicka wrote: > > > > > > > I think we could just output from generic code - I think it can be done by > > > > > final_scan_insn. I don't know however if we have a way to tell if the section > > > > > starts with a landing pad? > > > > > > > > Not sure either -- some insn note / bb note? Some flag on the label? > > > > At least the latter should be easy to add if it's not there already. > > > > > > > > Richard. > > > > > > Hi, > > > this is updated patch. I am now adding NOP_EXPR into the instruction stream. > > > This is done before shorten branches so alignment tracking works there as > > > expected. > > > Landing pads are having PRESERVE flag set, but that is also true about named > > > labels etc. So I think only safe way is to look them up from the EH tables > > > which is not that hard. first_in_partition is now called on every landing > > > pad in the cold section and it walks backward looking if it can be first. I added > > > visited set to be sure it runs in linear time. > > > > > > Boostrapped/regtested x86_64-linux, OK? > > > > It looks sensible. You leak the hash_set and I wonder if you can hook > > Hmm, isn't the hash_set supposed to destruct itself at the end of scope? Hmm, you are probably right ;) > > it in pass_convert_to_eh_region_ranges instead which runs before > > rest_of_handle_shorten_branches which means things can be entirely > > contained in except.c? > > Yep, that is a good idea. I did not look into pass.def, just searched > for convenient place to do it before branch relaxation (it probably ought > to run after mdep reorg because no one knows what those will do with the > nop :) > > Will re-test updated patch and commit. Thanks a lot! Did you see the inline comments? Thanks, Richard.