summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-08 16:08:24 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-08 16:08:24 +0000
commitd7c85fac4113c7c6a43781b366093eb9aca0b00f (patch)
tree92272592275d3d8489069e7330f5d4ac085d1104
parent962cad335a48bd0d355c85811e2562441ecc504d (diff)
downloadppe42-gcc-d7c85fac4113c7c6a43781b366093eb9aca0b00f.tar.gz
ppe42-gcc-d7c85fac4113c7c6a43781b366093eb9aca0b00f.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131398 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/omp-low.c1
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr34694.C15
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr34694.c15
5 files changed, 40 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 42648c88904..26d90934240 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index cf4ae12e291..94d63b6a56a 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d32be30a0b0..b049c87313e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/g++.dg/gomp/pr34694.C b/gcc/testsuite/g++.dg/gomp/pr34694.C
new file mode 100644
index 00000000000..5b98bd2a9a7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr34694.C
@@ -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" }
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr34694.c b/gcc/testsuite/gcc.dg/gomp/pr34694.c
new file mode 100644
index 00000000000..35cbf334064
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr34694.c
@@ -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" } */
+ }
+}
OpenPOWER on IntegriCloud