Commit c90eee44 by Jakub Jelinek Committed by Jakub Jelinek

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
parent b2ebd268
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
......@@ -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;
......
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.
// 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" }
}
}
/* 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" } */
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment