[Bug debug/36617] Debug info for OpenMP code is almost non-existent

2008-06-24 Thread jakub at gcc dot gnu dot org


--- Comment #1 from jakub at gcc dot gnu dot org  2008-06-24 10:01 ---
A testcase can be e.g.
int
foo (int *a, int *b, int *c, int *d)
{
  return *a + *b + *c + *d;
}

int
main (void)
{
  int vara = 1, varb = 0, varc, vard = 4;
  #pragma omp parallel shared (vara, varb) private (varc) firstprivate (vard)
  {
int vari, varj;
#pragma omp master
  vara++;
varc = 3;
vard++;
varj = 6;
foo (&vara, &varb, &varc, &vard);
#pragma omp for reduction (+:varb)
  for (vari = 0; vari < 10; vari++)
varb += 2;
  }
  return 0;
}

at -g -O0 -fopenmp.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36617



[Bug debug/36617] Debug info for OpenMP code is almost non-existent

2008-06-27 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2008-
   ||06/msg01745.html
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2008-06-27 14:25:15
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36617



[Bug debug/36617] Debug info for OpenMP code is almost non-existent

2008-06-27 Thread jakub at gcc dot gnu dot org


--- Comment #2 from jakub at gcc dot gnu dot org  2008-06-27 19:43 ---
Subject: Bug 36617

Author: jakub
Date: Fri Jun 27 19:42:32 2008
New Revision: 137198

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137198
Log:
PR debug/36617
* tree-cfg.c (struct move_stmt_d): Replace block field with
orig_block and new_block fields.
(move_stmt_r): Only set TREE_BLOCK to p->new_block if
if it used to be NULL, p->orig_block or if p->orig_block is NULL.
(move_block_to_fn): Replace vars_map and new_label_map arguments
with struct move_stmt_d pointer.
(replace_block_vars_by_duplicates): New function.
(move_sese_region_to_fn): Add ORIG_BLOCK argument.  Adjust
move_block_to_fn caller.  If ORIG_BLOCK is non-NULL, move over
all subblocks of ORIG_BLOCK to the new function.  Call
replace_block_vars_by_duplicates.
* tree-flow.h (move_sese_region_to_fn): Adjust prototype.
* omp-low.c (expand_omp_taskreg): Set TREE_USED on DECL_INITIAL
BLOCK of the new function.  Adjust move_sese_region_to_fn caller.
Prune vars with original DECL_CONTEXT from child_cfun->local_decls.
(expand_omp): Temporarily set input_location to the location of
region's controlling stmt.
(lower_omp_sections, lower_omp_for): Add a BLOCK into outermost
BIND_EXPR, push ctx->block_vars and gimplification vars into
the BIND_EXPR and its block's BLOCK_VARS instead of directly
into dest function.
(lower_omp_single): Set TREE_USED on the BIND_EXPR's BLOCK if
there are any BLOCK_VARS.
(lower_omp_taskreg): Set BLOCK on a BIND_EXPR containing the
OMP_PARALLEL or OMP_TASK stmt.
(lower_omp): Save and restore input_location around the lower_omp_1
call.

* testsuite/libgomp.c/debug-1.c: New test.

Added:
trunk/libgomp/testsuite/libgomp.c/debug-1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/omp-low.c
trunk/gcc/tree-cfg.c
trunk/gcc/tree-flow.h
trunk/libgomp/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36617



[Bug debug/36617] Debug info for OpenMP code is almost non-existent

2008-06-27 Thread jakub at gcc dot gnu dot org


--- Comment #3 from jakub at gcc dot gnu dot org  2008-06-27 22:43 ---
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36617