From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72334 invoked by alias); 18 Jul 2017 08:27:01 -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 71112 invoked by uid 89); 18 Jul 2017 08:27:00 -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,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=prohibits, Hx-languages-length:816 X-HELO: mail-yb0-f170.google.com Received: from mail-yb0-f170.google.com (HELO mail-yb0-f170.google.com) (209.85.213.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Jul 2017 08:26:59 +0000 Received: by mail-yb0-f170.google.com with SMTP id z37so4020536ybh.1 for ; Tue, 18 Jul 2017 01:26:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vVAT8x+6uVe17g1MuJblRf30a6dH7sYJmrdOqGBXpdk=; b=HBbekdz3KsYPljsOTnRAdka1ucGjOOpxx+G2DkQMUuZdVdFdg4qoZTjFEnnReYA2YN 7hfnvjQPiUtgCPqtCv+uRlw2UmZZCbSIelfW3zLz0PocQoj0x4D7tvn5Uo6nfDyoKTiP BKVgio2sy2wapGVGOPnX6xSo+5UjzeY9JBxNN7zfUjy3F51ebZVpCYqhETXIwKsh3x0u KASNCkuDEYylEvBs/Af3Dzkk9fl6BEq5xhKXNlxLHWf7iySwbVfOocjnsa0QJf6iSaIc GojHICJjlhFXFTkWOf4/njvglI+0XT75/NsIobV27zKb5T8ioneeGZKOb6B9+/gdAtDY 2m0w== X-Gm-Message-State: AIVw110b2Cdw4faA2wA9h8guh44bdONmcFgC1onJ4bE8ZefKL6SURy8A nja4Mc6I5k4m+EJYszwRQhU/Z3ruGQ== X-Received: by 10.37.42.4 with SMTP id q4mr327463ybq.204.1500366417604; Tue, 18 Jul 2017 01:26:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.40.3 with HTTP; Tue, 18 Jul 2017 01:26:56 -0700 (PDT) In-Reply-To: <20170717092719.GB33905@kam.mff.cuni.cz> References: <20170717092719.GB33905@kam.mff.cuni.cz> From: Yuri Gribov Date: Tue, 18 Jul 2017 08:27:00 -0000 Message-ID: Subject: Re: [PATCHv2][PING^2][PR 56727] Bypass PLT for recursive calls To: Jan Hubicka Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg01033.txt.bz2 On Mon, Jul 17, 2017 at 10:27 AM, Jan Hubicka wrote: >> Hi all, >> >> This is a new version of previous patch >> (https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00020.html), fixed >> after Rainer's remarks. > Hi, > the patch looks OK, but I wonder why you included can_be_discarded check? > If function is in comdat I believe the optimization still can happen. > Perhaps you only want to check DECL_EXTERNAL? TBH I was inspired by can_replace_by_local_alias which prohibits local alias for discardable functions. But I agree that situation here is different and it's indeed not needed (if function is discarded, it does not matter whether we optimized recursive calls). Could you elaborate why we still need DECL_EXTERNAL though? -Y