On Tue, Nov 18, 2014 at 06:31:59PM +0300, Ilya Verbin wrote:
> @@ -8287,7 +8289,9 @@ expand_omp_target (struct omp_region *region)
>    if (kind == GF_OMP_TARGET_KIND_REGION)
>      {
>        unsigned srcidx, dstidx, num;
> +#ifdef ENABLE_OFFLOADING
>        struct cgraph_node *node;
> +#endif

Please instead move the struct cgraph_node *node; declaration
right above where it is used for the first time.

There is no goto involved there, and it isn't in a switch either,
so you probably also can do just:
        struct cgraph_node *node = cgraph_node::get (child_fn);
instead.

Ok with that change.

> @@ -8414,18 +8418,22 @@ expand_omp_target (struct omp_region *region)
>        DECL_STRUCT_FUNCTION (child_fn)->curr_properties = 
> cfun->curr_properties;
>        cgraph_node::add_new_function (child_fn, true);
>  
> +#ifdef ENABLE_OFFLOADING
>        /* Add the new function to the offload table.  */
>        vec_safe_push (offload_funcs, child_fn);
> +#endif
>  
>        /* Fix the callgraph edges for child_cfun.  Those for cfun will be
>        fixed in a following pass.  */
>        push_cfun (child_cfun);
>        cgraph_edge::rebuild_edges ();
>  
> +#ifdef ENABLE_OFFLOADING
>        /* Prevent IPA from removing child_fn as unreachable, since there are 
> no
>        refs from the parent function to child_fn in offload LTO mode.  */
>        node = cgraph_node::get (child_fn);
>        node->mark_force_output ();
> +#endif
>  
>        /* Some EH regions might become dead, see PR34608.  If
>        pass_cleanup_cfg isn't the first pass to happen with the

        Jakub

Reply via email to