public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45112]  New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored
@ 2010-07-28 18:24 uweigand at gcc dot gnu dot org
  2010-07-28 19:37 ` [Bug c++/45112] " rguenth at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2010-07-28 18:24 UTC (permalink / raw)
  To: gcc-bugs

Building the following testcase fails with G++ 4.5 and later.
G++ 4.4 works fine.


struct JSString
{
  unsigned char mLength;
  static JSString unitStringTable[];
};

JSString JSString::unitStringTable[] __attribute__ ((aligned (8))) = { 1 };

int bug [__alignof__ (JSString::unitStringTable) >= 8 ? 1 : -1];


The test case is reduced from Mozilla, where the bug sometimes causes the
JavaScript interpreter to crash.  See also:
https://bugzilla.mozilla.org/show_bug.cgi?id=582593

The problem appears to be that cp-decl.c:duplicate_decls fails to merge
the DECL_USER_ALIGN flag from the definition into the declaration.

This bug was introduced by the following patch:
http://gcc.gnu.org/ml/gcc-patches/2009-06/msg00763.html

Before that patch, the DECL_USER_ALIGN flag was part of a block copied in whole
via memcpy by duplicate_decls.  The patch moved that flag to another location
outside that block, so it is no longer copied ...


-- 
           Summary: [4.5/4.6 regression] Aligned attribute on static class
                    member definition ignored
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: uweigand at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45112


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/45112] [4.5/4.6 regression] Aligned attribute on static class member definition ignored
  2010-07-28 18:24 [Bug c++/45112] New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored uweigand at gcc dot gnu dot org
@ 2010-07-28 19:37 ` rguenth at gcc dot gnu dot org
  2010-07-28 21:47 ` uweigand at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-28 19:37 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45112


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/45112] [4.5/4.6 regression] Aligned attribute on static class member definition ignored
  2010-07-28 18:24 [Bug c++/45112] New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored uweigand at gcc dot gnu dot org
  2010-07-28 19:37 ` [Bug c++/45112] " rguenth at gcc dot gnu dot org
@ 2010-07-28 21:47 ` uweigand at gcc dot gnu dot org
  2010-07-30 15:50 ` uweigand at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2010-07-28 21:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from uweigand at gcc dot gnu dot org  2010-07-28 21:47 -------
Proposed fix posted here:
http://gcc.gnu.org/ml/gcc-patches/2010-07/msg02223.html


-- 

uweigand at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |uweigand at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-28 21:47:11
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45112


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/45112] [4.5/4.6 regression] Aligned attribute on static class member definition ignored
  2010-07-28 18:24 [Bug c++/45112] New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored uweigand at gcc dot gnu dot org
  2010-07-28 19:37 ` [Bug c++/45112] " rguenth at gcc dot gnu dot org
  2010-07-28 21:47 ` uweigand at gcc dot gnu dot org
@ 2010-07-30 15:50 ` uweigand at gcc dot gnu dot org
  2010-07-30 16:19 ` [Bug c++/45112] [4.5 " uweigand at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2010-07-30 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from uweigand at gcc dot gnu dot org  2010-07-30 15:50 -------
Subject: Bug 45112

Author: uweigand
Date: Fri Jul 30 15:49:34 2010
New Revision: 162716

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162716
Log:
gcc/
        PR c++/45112
        * cp/decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.

gcc/testsuite/
        PR c++/45112
        * testsuite/g++.dg/pr45112.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/pr45112.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45112


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/45112] [4.5 regression] Aligned attribute on static class member definition ignored
  2010-07-28 18:24 [Bug c++/45112] New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored uweigand at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-07-30 15:50 ` uweigand at gcc dot gnu dot org
@ 2010-07-30 16:19 ` uweigand at gcc dot gnu dot org
  2010-07-31 15:46 ` uweigand at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2010-07-30 16:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from uweigand at gcc dot gnu dot org  2010-07-30 16:19 -------
Fixed in mainline.  Will check in to 4.5 after 4.5.1 release.


-- 

uweigand at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.5/4.6 regression] Aligned|[4.5 regression] Aligned
                   |attribute on static class   |attribute on static class
                   |member definition ignored   |member definition ignored
   Target Milestone|4.5.1                       |4.5.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45112


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/45112] [4.5 regression] Aligned attribute on static class member definition ignored
  2010-07-28 18:24 [Bug c++/45112] New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored uweigand at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-07-30 16:19 ` [Bug c++/45112] [4.5 " uweigand at gcc dot gnu dot org
@ 2010-07-31 15:46 ` uweigand at gcc dot gnu dot org
  2010-07-31 15:48 ` uweigand at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2010-07-31 15:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from uweigand at gcc dot gnu dot org  2010-07-31 15:46 -------
Subject: Bug 45112

Author: uweigand
Date: Sat Jul 31 15:46:15 2010
New Revision: 162783

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162783
Log:
gcc/
        PR c++/45112
        * cp/decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.

gcc/testsuite/
        PR c++/45112
        * testsuite/g++.dg/pr45112.C: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/pr45112.C
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/cp/decl.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45112


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/45112] [4.5 regression] Aligned attribute on static class member definition ignored
  2010-07-28 18:24 [Bug c++/45112] New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored uweigand at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-07-31 15:46 ` uweigand at gcc dot gnu dot org
@ 2010-07-31 15:48 ` uweigand at gcc dot gnu dot org
  2010-07-31 17:43 ` uweigand at gcc dot gnu dot org
  2010-07-31 17:44 ` uweigand at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2010-07-31 15:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from uweigand at gcc dot gnu dot org  2010-07-31 15:48 -------
Fixed in 4.5 branch (for 4.5.2) as well.


-- 

uweigand at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45112


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/45112] [4.5 regression] Aligned attribute on static class member definition ignored
  2010-07-28 18:24 [Bug c++/45112] New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored uweigand at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-07-31 15:48 ` uweigand at gcc dot gnu dot org
@ 2010-07-31 17:43 ` uweigand at gcc dot gnu dot org
  2010-07-31 17:44 ` uweigand at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2010-07-31 17:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from uweigand at gcc dot gnu dot org  2010-07-31 17:43 -------
Subject: Bug 45112

Author: uweigand
Date: Sat Jul 31 17:42:48 2010
New Revision: 162785

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162785
Log:
Move PR c++/45112 ChangeLog entry to correct location.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45112


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/45112] [4.5 regression] Aligned attribute on static class member definition ignored
  2010-07-28 18:24 [Bug c++/45112] New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored uweigand at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2010-07-31 17:43 ` uweigand at gcc dot gnu dot org
@ 2010-07-31 17:44 ` uweigand at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: uweigand at gcc dot gnu dot org @ 2010-07-31 17:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from uweigand at gcc dot gnu dot org  2010-07-31 17:44 -------
Subject: Bug 45112

Author: uweigand
Date: Sat Jul 31 17:43:59 2010
New Revision: 162786

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162786
Log:
Move PR c++/45112 ChangeLog entry to correct location.

Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/cp/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45112


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-07-31 17:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-28 18:24 [Bug c++/45112] New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored uweigand at gcc dot gnu dot org
2010-07-28 19:37 ` [Bug c++/45112] " rguenth at gcc dot gnu dot org
2010-07-28 21:47 ` uweigand at gcc dot gnu dot org
2010-07-30 15:50 ` uweigand at gcc dot gnu dot org
2010-07-30 16:19 ` [Bug c++/45112] [4.5 " uweigand at gcc dot gnu dot org
2010-07-31 15:46 ` uweigand at gcc dot gnu dot org
2010-07-31 15:48 ` uweigand at gcc dot gnu dot org
2010-07-31 17:43 ` uweigand at gcc dot gnu dot org
2010-07-31 17:44 ` uweigand at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).