From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100427 invoked by alias); 19 Jul 2017 14:01:09 -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 98472 invoked by uid 89); 19 Jul 2017 14:00:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=destruct, lot! X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Jul 2017 14:00:53 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 755D65467CE; Wed, 19 Jul 2017 16:00:44 +0200 (CEST) Date: Wed, 19 Jul 2017 14:01:00 -0000 From: Jan Hubicka To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: Fix Eh delivery in partitioned functions Message-ID: <20170719140043.GC38394@kam.mff.cuni.cz> References: <20170718072624.GA52973@kam.mff.cuni.cz> <20170718074423.GA7463@kam.mff.cuni.cz> <20170719125211.GA53494@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2017-07/txt/msg01155.txt.bz2 > 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? > 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! Honza