From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45400 invoked by alias); 22 May 2018 17:11:25 -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 45389 invoked by uid 89); 22 May 2018 17:11:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=our X-HELO: mail-ot0-f194.google.com Received: from mail-ot0-f194.google.com (HELO mail-ot0-f194.google.com) (74.125.82.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 May 2018 17:11:22 +0000 Received: by mail-ot0-f194.google.com with SMTP id l12-v6so21853387oth.6 for ; Tue, 22 May 2018 10:11:22 -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=COVXI9skc1tIusfnLTAInsZirwnOUN0f6aUfCrGpAe4=; b=Z3pUj1XC+dA0h3SMZ3+JagDiA56FsSIlDDJylsCJS7DCcsynzgtnmt4GEz1gOtYmc+ gYrn+cIdtz60KRjBcQu0N+n5qX2q3+Xg+ZrieI38paEtwoB1L/IpOyeUj2rOEfxk6itM 9gbGGtrIMC2WD5aOeEjsiPbo45q5rlbKKPYDGv9AVXOKWxJuzQX2adXMD9/B7HghRYZF zn/xfJf/xlKdZVMNl0rh46mbf3WSbX+75yjKokBdUTWjuIEjUt9li+NTWQt+zVW1za3h T6K0qU6tzV1ugCDlHXWtE0HLN1XTgsNlhDk/SAPbWdd71LnMNuc0OsFU9KGFVAXPNeKt Z3Kw== X-Gm-Message-State: ALKqPweej5AorJy5k4ynWxVoLHMRzMFlnF7d3K8JnWfWHEc0qcZr9fp8 qOt5QlMFaq391Oc8OMyIha9gRaKbNH1eHQg/yVk= X-Google-Smtp-Source: AB8JxZqVK9126lyyU2RCTe0952tFZ+cL6XYJGMKm2E2dj4iQhGKIe4m4NepdtHi+RB3e8gbRhRxuYc0s/WypVWFiP+c= X-Received: by 2002:a9d:118f:: with SMTP id v15-v6mr17571180otf.125.1527009080965; Tue, 22 May 2018 10:11:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.46.18 with HTTP; Tue, 22 May 2018 10:11:20 -0700 (PDT) In-Reply-To: <20180522162133.GA7726@kam.mff.cuni.cz> References: <20180522162133.GA7726@kam.mff.cuni.cz> From: "H.J. Lu" Date: Tue, 22 May 2018 17:13:00 -0000 Message-ID: Subject: Re: PING^2: [PATCH] Don't mark IFUNC resolver as only called directly To: Jan Hubicka Cc: Richard Biener , GCC Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg01168.txt.bz2 On Tue, May 22, 2018 at 9:21 AM, Jan Hubicka wrote: >> >>>>> > class ipa_opt_pass_d; >> >>>>> > typedef ipa_opt_pass_d *ipa_opt_pass; >> >>>>> > @@ -2894,7 +2896,8 @@ cgraph_node::only_called_directly_or_aliased_p (void) >> >>>>> > && !DECL_STATIC_CONSTRUCTOR (decl) >> >>>>> > && !DECL_STATIC_DESTRUCTOR (decl) >> >>>>> > && !used_from_object_file_p () >> >>>>> > - && !externally_visible); >> >>>>> > + && !externally_visible >> >>>>> > + && !lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl))); >> >>>>> >> >>>>> How's it handled for our own generated resolver functions? That is, >> >>>>> isn't there sth cheaper than doing a lookup_attribute here? I see >> >>>>> that make_dispatcher_decl nor ix86_get_function_versions_dispatcher >> >>>>> adds the 'ifunc' attribute (though they are TREE_PUBLIC there). >> >>>> >> >>>> Is there any drawback of setting force_output flag? >> >>>> Honza >> >>> >> >>> Setting force_output may prevent some optimizations. Can we add a bit >> >>> for IFUNC resolver? >> >>> >> >> >> >> Here is the patch to add ifunc_resolver to cgraph_node. Tested on x86-64 >> >> and i686. Any comments? >> >> >> > >> > PING: >> > >> > https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00647.html >> > >> >> PING. > OK, but please extend the verifier that ifunc_resolver flag is equivalent to > lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl)) > so we are sure things stays in sync. > Like this diff --git a/gcc/symtab.c b/gcc/symtab.c index 80f6f910c3b..954920b6dff 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -998,6 +998,13 @@ symtab_node::verify_base (void) error ("function symbol is not function"); error_found = true; } + else if ((lookup_attribute ("ifunc", DECL_ATTRIBUTES (decl)) + != NULL) + != dyn_cast (this)->ifunc_resolver) + { + error ("inconsistent `ifunc' attribute"); + error_found = true; + } } else if (is_a (this)) { Thanks. -- H.J.