re PR middle-end/34694 (Wrong line number for uninitialized variable)

PR middle-end/34694
	* omp-low.c (copy_var_decl): Copy also DECL_SOURCE_LOCATION.

	* gcc.dg/gomp/pr34694.c: New test.
	* g++.dg/gomp/pr34694.C: New test.

From-SVN: r131398
This commit is contained in:
Jakub Jelinek 2008-01-08 17:08:24 +01:00 committed by Jakub Jelinek
parent b2ebd26837
commit c90eee444c
5 changed files with 40 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2008-01-08 Jakub Jelinek <jakub@redhat.com>
PR middle-end/34694
* omp-low.c (copy_var_decl): Copy also DECL_SOURCE_LOCATION.
2008-01-08 Uros Bizjak <ubizjak@gmail.com>
PR target/34702

View File

@ -529,6 +529,7 @@ copy_var_decl (tree var, tree name, tree type)
DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (var);
DECL_IGNORED_P (copy) = DECL_IGNORED_P (var);
DECL_CONTEXT (copy) = DECL_CONTEXT (var);
DECL_SOURCE_LOCATION (copy) = DECL_SOURCE_LOCATION (var);
TREE_USED (copy) = 1;
DECL_SEEN_IN_BIND_EXPR_P (copy) = 1;

View File

@ -1,5 +1,9 @@
2008-01-08 Jakub Jelinek <jakub@redhat.com>
PR middle-end/34694
* gcc.dg/gomp/pr34694.c: New test.
* g++.dg/gomp/pr34694.C: New test.
PR c++/33890
* g++.dg/gomp/pr33890.C: New test.

View File

@ -0,0 +1,15 @@
// PR middle-end/34694
// { dg-do compile }
// { dg-options "-O -fopenmp -Wall" }
int i;
void
foo ()
{
#pragma omp parallel
{
int j; // { dg-warning "note: 'j' was declared here" }
i = j; // { dg-warning "is used uninitialized" }
}
}

View File

@ -0,0 +1,15 @@
/* PR middle-end/34694 */
/* { dg-do compile } */
/* { dg-options "-O -fopenmp -Wall" } */
int i;
void
foo ()
{
#pragma omp parallel
{
int j; /* { dg-message "note: 'j' was declared here" } */
i = j; /* { dg-warning "is used uninitialized" } */
}
}