This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Output DIEs for outlined OpenMP functions in correct lexical scope
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 5 May 2017 14:23:14 +0300 (MSK)
- Subject: Re: [PATCH] Output DIEs for outlined OpenMP functions in correct lexical scope
- Authentication-results: sourceware.org; auth=none
- References: <20170504174551.27e1ec17@pinnacle.lan>
On Thu, 4 May 2017, Kevin Buettner wrote:
> diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
> index 5c48b78..7029951 100644
> --- a/gcc/omp-expand.c
> +++ b/gcc/omp-expand.c
> @@ -667,6 +667,25 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
Outlined functions are also used for 'omp task' and 'omp target' regions, but
here only 'omp parallel' is handled. Will this code need to be duplicated for
those region types?
> tree child_fndecl = gimple_omp_parallel_child_fn (entry_stmt);
> t2 = build_fold_addr_expr (child_fndecl);
>
> + if (gimple_block (entry_stmt) != NULL_TREE
> + && TREE_CODE (gimple_block (entry_stmt)) == BLOCK)
Here and also below, ...
> + {
> + tree b = BLOCK_SUPERCONTEXT (gimple_block (entry_stmt));
> +
> + /* Add child_fndecl to var chain of the supercontext of the
> + block corresponding to entry_stmt. This ensures that debug
> + info for the outlined function will be emitted for the correct
> + lexical scope. */
> + if (b != NULL_TREE && TREE_CODE (b) == BLOCK)
... here, I'm curious why the conditionals are necessary -- I don't see why the
conditions can be sometimes true and sometimes false. Sorry if I'm missing
something obvious.
Thanks.
Alexander