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