From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 3ED6B3857812 for ; Tue, 2 Mar 2021 10:34:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3ED6B3857812 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mliska@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 15D84ABF4; Tue, 2 Mar 2021 10:34:44 +0000 (UTC) Subject: Re: [PATCH] C++: target attribute - local decl To: Jason Merrill , gcc-patches@gcc.gnu.org References: <15035626-d39b-cb2a-f9b6-272503b16ba5@suse.cz> <43c9c10d-077a-633d-92d4-d769c5838e6f@redhat.com> <41c44de0-9d88-4a03-079e-a1af4502268b@suse.cz> <34cad5cc-7d96-a348-4e4a-c17673475407@redhat.com> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <41174163-b47c-f105-a5f1-8bb2177feefe@suse.cz> Date: Tue, 2 Mar 2021 11:34:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <34cad5cc-7d96-a348-4e4a-c17673475407@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 10:34:46 -0000 On 3/1/21 8:58 PM, Jason Merrill wrote: > On 3/1/21 11:59 AM, Martin Liška wrote: >> On 3/1/21 5:36 PM, Jason Merrill wrote: >>> On 3/1/21 7:43 AM, Martin Liška wrote: >>>> On 2/22/21 11:53 PM, Jason Merrill wrote: >>>>> The problem seems to be with the handling of local decls.  If DECL_LOCAL_DECL_P, you need to look at DECL_LOCAL_DECL_ALIAS to find the namespace-scope decl.  But then if there is no preceding namespace-scope declaration, the new decl created by push_local_extern_decl_alias doesn't have a cgraph node, either.  I guess maybe_function_versions also needs to look through DECL_LOCAL_DECL_ALIAS. >>>> >>>> Ah, I see. Are you sure about the name 'maybe_function_versions'? I can't find it. >>> >>> Ah, it's maybe_version_functions, sorry. >> >> Thanks, I see the function now. >> So about your guess: >> >>> I guess maybe_function_versions also needs to look through DECL_LOCAL_DECL_ALIAS. >> >> Do you mean maybe_version_functions's argument 'record' should depend on DECL_LOCAL_DECL_ALIAS of newdecl/oldddecl >> (if present)? Or that DECL_FUNCTION_VERSIONED should be set for DECL_LOCAL_DECL_ALIASes of the newdecl/olddecl >> function declarations? > > The latter. I see, but will not help us. Problem is that #2 0x00000000015d8899 in ix86_get_function_versions_dispatcher (decl=0x7ffff7755000) at /home/marxin/Programming/gcc/gcc/config/i386/i386-features.c:2862 is called for a declaration for which Breakpoint 5, maybe_version_functions (newdecl=, olddecl=, record=false) at /home/marxin/Programming/gcc/gcc/cp/decl.c:1118 is called with record=false. So that cgraph_node is not created for it. Or is a possible solution that get_function_version_dispatcher should look through the DECL_LOCAL_DECL_ALIAS? Thanks, Martin > > Jason >