public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/54652] New: ICE with -g
Date: Fri, 21 Sep 2012 09:49:00 -0000	[thread overview]
Message-ID: <bug-54652-4@http.gcc.gnu.org/bugzilla/> (raw)


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

             Bug #: 54652
           Summary: ICE with -g
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: jason@gcc.gnu.org


typedef unsigned long L __attribute__ ((aligned));
typedef unsigned long L __attribute__ ((aligned));

template <typename T>
struct S
{
  union U { L l; } u;
};

S <int> s;

ICEs with -g, TYPE_NAME seems to be garbage.
The problem is that handle_aligned_attribute first (with L as decl):
          tree tt = TREE_TYPE (decl);
          *type = build_variant_type_copy (*type);
          DECL_ORIGINAL_TYPE (decl) = tt;
          TYPE_NAME (*type) = decl;
          TREE_USED (*type) = TREE_USED (decl);
          TREE_TYPE (decl) = *type;
then duplicate_decls is called on the L olddecl (with new L as newdecl), where
TYPE_NAME (TREE_TYPE (olddecl)) == olddecl and
TYPE_NAME (TREE_TYPE (newdecl)) == newdecl, in merge_types newdecl's type wins,
and eventually ggc_free (newdecl);
So, either something should have changed TYPE_NAME (newtype) from newdecl to
olddecl before ggc_free (I guess that would be preferred, but can't it be
TYPE_NAME of other related types too?), or we shouldn't ggc_free TYPE_DECLs.
Jason, can you please look into this?


             reply	other threads:[~2012-09-21  9:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21  9:49 jakub at gcc dot gnu.org [this message]
2013-10-19 22:44 ` [Bug c++/54652] [4.7/4.8/4.9 Regression] " reichelt at gcc dot gnu.org
2013-10-25 11:21 ` rguenth at gcc dot gnu.org
2014-01-27 19:16 ` jason at gcc dot gnu.org
2014-01-28  4:32 ` jason at gcc dot gnu.org
2014-01-28 13:45 ` jason at gcc dot gnu.org
2014-01-28 13:51 ` jason at gcc dot gnu.org
2014-01-28 13:51 ` jason at gcc dot gnu.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-54652-4@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).