While we have VAR_DECLs with DECL_VALUE_EXPR pointing to where various shared etc. vars really live, those don't make it into the debug info at all, as the newly created function has just one BLOCK with all the vars and that doesn't have TREE_USED set on it. A quick hack: --- omp-low.c.jj4 2008-06-20 00:27:49.000000000 +0200 +++ omp-low.c 2008-06-23 22:21:46.000000000 +0200 @@ -3251,6 +3251,7 @@ expand_omp_taskreg (struct omp_region *r block = DECL_INITIAL (child_fn); BLOCK_VARS (block) = list2chain (child_cfun->local_decls); DECL_SAVED_TREE (child_fn) = bb_stmt_list (single_succ (entry_bb)); + TREE_USED (block) = 1;
/* Reset DECL_CONTEXT on function arguments. */ for (t = DECL_ARGUMENTS (child_fn); t; t = TREE_CHAIN (t)) outputs some debug info for the vars, the problem is that the same var can be then multiple times in the debug info. I guess we really should duplicate all the BLOCKs within #pragma omp parallel or #pragma omp task (not sure if we just should set BLOCK_ABSTRACT_ORIGIN to the original BLOCK), and stick the vars for debuginfo purposes into those BLOCKs. -- Summary: Debug info for OpenMP code is almost non-existent Product: gcc Version: 4.3.1 Status: UNCONFIRMED Keywords: openmp Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36617