aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-12-05 21:49:38 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-12-05 21:49:38 +0100
commit156030d35f7c8edca2f7b801212a0f201b4369bc (patch)
tree2b0dab5f75b3bf875ca8d4fcecdb1a4ec85163ec /gcc
parenta9eba00e1b73fe6ac5f6d3dcad4a015a4e8eb4d4 (diff)
downloadgcc-156030d35f7c8edca2f7b801212a0f201b4369bc.zip
gcc-156030d35f7c8edca2f7b801212a0f201b4369bc.tar.gz
gcc-156030d35f7c8edca2f7b801212a0f201b4369bc.tar.bz2
re PR c/51339 (ICE: in convert_move, at expr.c:326 with -fopenmp and parallel for)
PR c/51339 * c-decl.c (c_finish_incomplete_decl, finish_decl): Call relayout_decl instead of layout_decl. * gcc.dg/gomp/pr51339.c: New test. From-SVN: r182026
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-decl.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr51339.c15
4 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cc90010..9767de4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/51339
+ * c-decl.c (c_finish_incomplete_decl, finish_decl): Call
+ relayout_decl instead of layout_decl.
+
2011-12-05 Richard Sandiford <rdsandiford@googlemail.com>
* resource.c (init_resource_info): Only consider EXIT_IGNORE_STACK
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 44358a8..4338fdf 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -719,7 +719,7 @@ c_finish_incomplete_decl (tree decl)
complete_array_type (&TREE_TYPE (decl), NULL_TREE, true);
- layout_decl (decl, 0);
+ relayout_decl (decl);
}
}
}
@@ -4311,7 +4311,7 @@ finish_decl (tree decl, location_t init_loc, tree init,
if (DECL_INITIAL (decl))
TREE_TYPE (DECL_INITIAL (decl)) = type;
- layout_decl (decl, 0);
+ relayout_decl (decl);
}
if (TREE_CODE (decl) == VAR_DECL)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c78d3f4..73cef0b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/51339
+ * gcc.dg/gomp/pr51339.c: New test.
+
2011-12-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51399
diff --git a/gcc/testsuite/gcc.dg/gomp/pr51339.c b/gcc/testsuite/gcc.dg/gomp/pr51339.c
new file mode 100644
index 0000000..198e4c1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr51339.c
@@ -0,0 +1,15 @@
+/* PR c/51339 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+char g[] = "g";
+
+void
+foo (void)
+{
+#pragma omp parallel sections firstprivate (g) lastprivate (g)
+ {
+ #pragma omp section
+ g[0] = 'h';
+ }
+}