From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by sourceware.org (Postfix) with ESMTP id F0CA2386F45A for ; Tue, 22 Sep 2020 07:37:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F0CA2386F45A 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-437-M5KrSYzIMTqTk9Ozi68Y6w-1; Tue, 22 Sep 2020 03:37:06 -0400 X-MC-Unique: M5KrSYzIMTqTk9Ozi68Y6w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F3208064C2; Tue, 22 Sep 2020 07:37:05 +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 85A8827C29; Tue, 22 Sep 2020 07:37:04 +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 08M7b1rC010989; Tue, 22 Sep 2020 09:37:01 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 08M7axdU010988; Tue, 22 Sep 2020 09:36:59 +0200 Date: Tue, 22 Sep 2020 09:36:59 +0200 From: Jakub Jelinek To: Tobias Burnus Cc: Tobias Burnus , Jan Hubicka , gcc-patches Subject: Re: [Patch] OpenMP: Handle cpp_implicit_alias in declare-target discovery (PR96390) Message-ID: <20200922073659.GV2176@tucnak> Reply-To: Jakub Jelinek References: <0bbc1a10-2895-ef31-bb9b-95fd0eaac747@codesourcery.com> <20200831155311.GS18149@tucnak> <20200916103647.GV21814@tucnak> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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, 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 07:37:12 -0000 On Tue, Sep 22, 2020 at 09:11:48AM +0200, Tobias Burnus wrote: > > Okay – or do we find more issues? I'm afraid so. > + if (omp_declare_target_fn_p (decl) > + || lookup_attribute ("omp declare target host", > + DECL_ATTRIBUTES (decl))) > + return NULL_TREE; I'm worried that omp_declare_target_fn_p could be true and so this would punt, but the intermediate aliases would be marked. Or the aliases would be marked and the ultimate alias would not. Consider: int v; #pragma omp declare target to (v) void foo (void) { v++; } void bar (void) __attribute__((alias ("foo"))); #pragma omp declare target to (bar) void baz (void) __attribute__((alias ("foo"))); void qux (void) { #pragma omp target { bar (); // Here the ultimate alias is not marked, so the code marks it, // and adds another "omp declare target" attribute to bar, // which it shouldn't. baz (); // At this point, foo is marked, so the code wouldn't mark // baz alias as "omp declare target". } } So, I think it is fine to find the ultimate alias, but the loop to mark the intermediate aliases should be invoked regardless of how decl is or is not marked, and should test in each step whether it should or should not be marked. Jakub