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

Reply via email to