diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-decl.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/gomp/pr51339.c | 15 |
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'; + } +} |