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

* [Bug c++/54652] [4.7/4.8/4.9 Regression] ICE with -g
  2012-09-21  9:49 [Bug c++/54652] New: ICE with -g jakub at gcc dot gnu.org
@ 2013-10-19 22:44 ` reichelt at gcc dot gnu.org
  2013-10-25 11:21 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-10-19 22:44 UTC (permalink / raw)
  To: gcc-bugs

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |3.4.0
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2013-10-19
                 CC|                            |reichelt at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|ICE with -g                 |[4.7/4.8/4.9 Regression]
                   |                            |ICE with -g
   Target Milestone|---                         |4.7.4
      Known to fail|                            |4.0.0, 4.1.0, 4.2.0, 4.3.0,
                   |                            |4.4.0, 4.5.0, 4.6.0, 4.7.0,
                   |                            |4.8.0, 4.9.0

--- Comment #1 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
Confirmed. Even shorter testcase (which crashes since GCC 4.0.0):

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

L l;
=====================================================

bug.cc:4:4: internal compiler error: tree check: expected identifier_node, have
<invalid tree code> in modified_type_die, at dwarf2out.c:10376
 L l;
    ^
0xd15bb4 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9301
0x8844b0 tree_check
        ../../gcc/gcc/tree.h:2674
0x8844b0 modified_type_die
        ../../gcc/gcc/dwarf2out.c:10376
0x8859b9 add_type_attribute
        ../../gcc/gcc/dwarf2out.c:16717
0x892dd0 gen_variable_die
        ../../gcc/gcc/dwarf2out.c:18621
0x87eea1 gen_decl_die
        ../../gcc/gcc/dwarf2out.c:20294
0xb17633 emit_debug_global_declarations(tree_node**, int)
        ../../gcc/gcc/toplev.c:531
0x55a520 wrapup_globals_for_namespace(tree_node*, void*)
        ../../gcc/gcc/cp/decl.c:876
0x55759c walk_namespaces_r
        ../../gcc/gcc/cp/decl.c:843
0x625533 cp_write_global_declarations()
        ../../gcc/gcc/cp/decl2.c:4455
Please submit a full bug report, [etc.]


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

* [Bug c++/54652] [4.7/4.8/4.9 Regression] ICE with -g
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-25 11:21 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
re-confirmed on trunk.


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

* [Bug c++/54652] [4.7/4.8/4.9 Regression] ICE with -g
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-27 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org


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

* [Bug c++/54652] [4.7/4.8/4.9 Regression] ICE with -g
  2012-09-21  9:49 [Bug c++/54652] New: ICE with -g jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-28  4:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Jan 28 04:31:30 2014
New Revision: 207169

URL: http://gcc.gnu.org/viewcvs?rev=207169&root=gcc&view=rev
Log:
    PR c++/54652
    * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.

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


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

* [Bug c++/54652] [4.7/4.8/4.9 Regression] ICE with -g
  2012-09-21  9:49 [Bug c++/54652] New: ICE with -g jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-28 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Jan 28 13:45:08 2014
New Revision: 207191

URL: http://gcc.gnu.org/viewcvs?rev=207191&root=gcc&view=rev
Log:
    PR c++/54652
    * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/g++.dg/ext/attrib48.C
Modified:
    branches/gcc-4_8-branch/gcc/cp/ChangeLog
    branches/gcc-4_8-branch/gcc/cp/decl.c


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

* [Bug c++/54652] [4.7/4.8/4.9 Regression] ICE with -g
  2012-09-21  9:49 [Bug c++/54652] New: ICE with -g jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-01-28 13:51 ` jason at gcc dot gnu.org
@ 2014-01-28 13:51 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-28 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.


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

* [Bug c++/54652] [4.7/4.8/4.9 Regression] ICE with -g
  2012-09-21  9:49 [Bug c++/54652] New: ICE with -g jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-28 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Jan 28 13:51:15 2014
New Revision: 207192

URL: http://gcc.gnu.org/viewcvs?rev=207192&root=gcc&view=rev
Log:
    PR c++/54652
    * decl.c (duplicate_decls): Always use oldtype for TYPE_DECL.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/ext/attrib48.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/decl.c


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