public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54652] New: ICE with -g
@ 2012-09-21  9:49 jakub at gcc dot gnu.org
  2013-10-19 22:44 ` [Bug c++/54652] [4.7/4.8/4.9 Regression] " reichelt at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-09-21  9:49 UTC (permalink / raw)
  To: gcc-bugs


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?


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

end of thread, other threads:[~2014-01-28 13:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-21  9:49 [Bug c++/54652] New: ICE with -g jakub at gcc dot gnu.org
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

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).