From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id A66DB384C004 for ; Tue, 22 Sep 2020 14:25:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A66DB384C004 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-47-FPIo79siN06aV2r26ZNu6g-1; Tue, 22 Sep 2020 10:24:57 -0400 X-MC-Unique: FPIo79siN06aV2r26ZNu6g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B34A64086; Tue, 22 Sep 2020 14:24:55 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-37.ams2.redhat.com [10.36.112.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B791E5DD99; Tue, 22 Sep 2020 14:24:54 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 08MEOfHj015537; Tue, 22 Sep 2020 16:24:46 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 08MEOXdj015536; Tue, 22 Sep 2020 16:24:33 +0200 Date: Tue, 22 Sep 2020 16:24:33 +0200 From: Jakub Jelinek To: Tobias Burnus Cc: Jan Hubicka , gcc-patches Subject: Re: [Patch] OpenMP: Handle cpp_implicit_alias in declare-target discovery (PR96390) Message-ID: <20200922142433.GZ2176@tucnak> Reply-To: Jakub Jelinek References: <0bbc1a10-2895-ef31-bb9b-95fd0eaac747@codesourcery.com> <20200831155311.GS18149@tucnak> <20200916103647.GV21814@tucnak> <20200922073659.GV2176@tucnak> <07508a46-2ea3-ac17-a398-a0f4dd56c556@codesourcery.com> MIME-Version: 1.0 In-Reply-To: <07508a46-2ea3-ac17-a398-a0f4dd56c556@codesourcery.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, 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, 22 Sep 2020 14:25:04 -0000 On Tue, Sep 22, 2020 at 04:11:19PM +0200, Tobias Burnus wrote: > + while (node->alias_target) > + { > + node = node->ultimate_alias_target (); At least in theory, ultimate_alias_target can look through multiple aliases. While it might not do that most of the time because this is executed quite early, I think we have no guarantees it will never do it. So I'd prefer what you had in the earlier patch, i.e. do the ultimate_alias_target call + loop to find the ultimate node, and then in another loop go from the original node (inclusive) up to the ultimate one (exclusive) and do what you do in this loop now. Does that make sense? > + if (!omp_declare_target_fn_p (node->decl) > + && !lookup_attribute ("omp declare target host", > + DECL_ATTRIBUTES (node->decl))) > + { > + node->offloadable = 1; > + DECL_ATTRIBUTES (node->decl) > + = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (node->decl)); > + } > + node = symtab_node::get (node->alias_target); Jakub