Message ID | 20111205202144.GN27242@tyan-ft48-01.lab.bos.redhat.com |
---|---|
State | New |
Headers | show |
On Mon, 5 Dec 2011, Jakub Jelinek wrote: > 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. > > * gcc.dg/gomp/pr51339.c: New test. OK.
On Thu, Feb 09, 2012 at 12:11:45AM +0100, Ulrich Weigand wrote: > The finish_decl change appears to have introduced a regression > in attribute ((aligned)) handling. With the following code: > > extern const int foo[]; > const int __attribute__((aligned(16))) foo[] = { 0 }; > > the attribute now seems to be ignored; reverting the change > above causes the attribute to be honored again. Seems the bug is elsewhere though, testing a fix, see PR52181 I've filed for this. Jakub
--- gcc/c-decl.c.jj 2011-11-28 17:58:04.000000000 +0100 +++ gcc/c-decl.c 2011-12-05 16:39:46.713393079 +0100 @@ -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_ if (DECL_INITIAL (decl)) TREE_TYPE (DECL_INITIAL (decl)) = type; - layout_decl (decl, 0); + relayout_decl (decl); } if (TREE_CODE (decl) == VAR_DECL) --- gcc/testsuite/gcc.dg/gomp/pr51339.c.jj 2011-12-05 17:23:12.190987532 +0100 +++ gcc/testsuite/gcc.dg/gomp/pr51339.c 2011-12-05 17:22:50.000000000 +0100 @@ -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'; + } +}