public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "uweigand at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/45112]  New: [4.5/4.6 regression] Aligned attribute on static class member definition ignored
Date: Wed, 28 Jul 2010 18:24:00 -0000	[thread overview]
Message-ID: <bug-45112-1501@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2010-07-28 18:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 18:24 uweigand at gcc dot gnu dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-45112-1501@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).