From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21089 invoked by alias); 16 Jan 2019 22:48:52 -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 20697 invoked by uid 89); 16 Jan 2019 22:48:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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, 16 Jan 2019 22:48:24 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5CD9780F75; Wed, 16 Jan 2019 22:48:10 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-2.rdu2.redhat.com [10.10.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 152D52E04B; Wed, 16 Jan 2019 22:48:08 +0000 (UTC) Subject: Re: [PATCH] Don't DCE const/pure calls that can throw if cfg can't be altered (PR rtl-optimization/88870) To: Jakub Jelinek , Richard Biener , Eric Botcazou Cc: gcc-patches@gcc.gnu.org References: <20190116224311.GA30353@tucnak> From: Jeff Law Openpgp: preference=signencrypt Message-ID: Date: Wed, 16 Jan 2019 22:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20190116224311.GA30353@tucnak> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00957.txt.bz2 On 1/16/19 3:43 PM, Jakub Jelinek wrote: > Hi! > > For normal instructions, deletable_insn_p has: > /* Don't delete insns that may throw if we cannot do so. */ > if (!(cfun->can_delete_dead_exceptions && can_alter_cfg) > && !insn_nothrow_p (insn)) > return false; > > The following patch adds that for the const/pure non-looping calls > that are handled earlier in the function as well (I haven't moved this test > earlier so we don't check insn_nothrow_p on jump insns etc.). > > The other change is just to handle those calls the same as non-const/pure, > if we never consider them to be deletable, there is no point in > find_call_stack_args for them, like we don't do that for normal calls. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2019-01-16 Jakub Jelinek > > PR rtl-optimization/88870 > * dce.c (deletable_insn_p): Never delete const/pure calls that can > throw if we can't alter the cfg or delete dead exceptions. > (mark_insn): Don't call find_call_stack_args for such calls. > > * gcc.dg/pr88870.c: New test. OK. Though I wonder if we want to continue to support -fnon-call-exceptions. With GCJ gone is there any value left in that capability? There's little doubt in my mind other parts of GCC are not -fnon-call-exception safe. jeff