public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda
@ 2012-03-20 15:33 scovich at gmail dot com
  2012-04-14 21:23 ` [Bug c++/52637] [4.7/4.8 regression] ICE producing debug info for c++11 code using local class as template argument jason at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: scovich at gmail dot com @ 2012-03-20 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52637
           Summary: ICE producing debug info for c++11 code using
                    templates/decltype/lambda
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: scovich@gmail.com


The following code snippet produces an ICE when compiled by gcc-4.7.0-RC1 with
flags `-std=gnu++11 -g -c' (gcc-4.6.2 and 4.5.3 accept it):

=== bug.cpp ===
template <typename T>
struct foo {
    foo(T &fn) { }
};

template <class T, typename V>
void bar(T*, V) {
    auto x = [&] { };
    auto y = foo<decltype(x)>(x);
}

template <typename T>
void bar(T* t) { bar(t, [&] { }); }

struct baz {
    void bar() { ::bar(this); }
};
===============

$ ~/apps/gcc-4.7-RC1/bin/g++ -std=gnu++11 -g bug.cpp
bug.cpp:17:2: internal compiler error: in output_die, at dwarf2out.c:8463
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

The testcase was distilled from a multi-thousand line app with help from
multidelta.

My platform is i686-pc-cygwin, in case that matters.


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

* [Bug c++/52637] [4.7/4.8 regression] ICE producing debug info for c++11 code using local class as template argument
  2012-03-20 15:33 [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda scovich at gmail dot com
@ 2012-04-14 21:23 ` jason at gcc dot gnu.org
  2012-04-26 14:00 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-04-14 21:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.6.3
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2012-04-14
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
         Depends on|                            |51650
     Ever Confirmed|0                           |1
            Summary|ICE producing debug info    |[4.7/4.8 regression] ICE
                   |for c++11 code using        |producing debug info for
                   |templates/decltype/lambda   |c++11 code using local
                   |                            |class as template argument

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2012-04-14 21:22:53 UTC ---
Neither decltype nor lambda are needed for this bug, just use of a local type
as a template parameter:

template <typename T>
struct C { };

template <typename V>
void f(V v) {
  struct B {};
  C<B> c;
}

template <typename T>
void g(T t) {
  struct A { } a;
  f (a);
}

struct D {
  void h() { g(0); }
};

This seems to be a result of the fix for PR 51650; we want to emit debug info
about C<B>, so B ends up on the limbo list.  When we walk the limbo list we
decide to emit f<A>, so A ends up on the limbo list.  But it gets added to the
beginning, so the list walk never sees it, and when we get around to emitting
the debug info for f<A> it can't find the A to refer to, and ICEs.

Before the patch for 51650 we didn't try to emit f<A> to be context for B.


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

* [Bug c++/52637] [4.7/4.8 regression] ICE producing debug info for c++11 code using local class as template argument
  2012-03-20 15:33 [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda scovich at gmail dot com
  2012-04-14 21:23 ` [Bug c++/52637] [4.7/4.8 regression] ICE producing debug info for c++11 code using local class as template argument jason at gcc dot gnu.org
@ 2012-04-26 14:00 ` rguenth at gcc dot gnu.org
  2012-04-26 14:14 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-26 14:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.1


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

* [Bug c++/52637] [4.7/4.8 regression] ICE producing debug info for c++11 code using local class as template argument
  2012-03-20 15:33 [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda scovich at gmail dot com
  2012-04-14 21:23 ` [Bug c++/52637] [4.7/4.8 regression] ICE producing debug info for c++11 code using local class as template argument jason at gcc dot gnu.org
  2012-04-26 14:00 ` rguenth at gcc dot gnu.org
@ 2012-04-26 14:14 ` rguenth at gcc dot gnu.org
  2012-05-31 21:55 ` [Bug c++/52637] [4.7 " jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-26 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

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


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

* [Bug c++/52637] [4.7 regression] ICE producing debug info for c++11 code using local class as template argument
  2012-03-20 15:33 [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda scovich at gmail dot com
                   ` (2 preceding siblings ...)
  2012-04-26 14:14 ` rguenth at gcc dot gnu.org
@ 2012-05-31 21:55 ` jason at gcc dot gnu.org
  2012-06-14  8:14 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-05-31 21:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         Depends on|                            |53470
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
            Summary|[4.7/4.8 regression] ICE    |[4.7 regression] ICE
                   |producing debug info for    |producing debug info for
                   |c++11 code using local      |c++11 code using local
                   |class as template argument  |class as template argument

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2012-05-31 21:41:55 UTC ---
This was fixed on the trunk by r187106, which caused bug 53470.


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

* [Bug c++/52637] [4.7 regression] ICE producing debug info for c++11 code using local class as template argument
  2012-03-20 15:33 [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda scovich at gmail dot com
                   ` (3 preceding siblings ...)
  2012-05-31 21:55 ` [Bug c++/52637] [4.7 " jason at gcc dot gnu.org
@ 2012-06-14  8:14 ` rguenth at gcc dot gnu.org
  2012-06-20  7:22 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-14  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.7.1                       |4.7.2

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-14 08:14:18 UTC ---
GCC 4.7.1 is being released, adjusting target milestone.


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

* [Bug c++/52637] [4.7 regression] ICE producing debug info for c++11 code using local class as template argument
  2012-03-20 15:33 [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda scovich at gmail dot com
                   ` (4 preceding siblings ...)
  2012-06-14  8:14 ` rguenth at gcc dot gnu.org
@ 2012-06-20  7:22 ` jason at gcc dot gnu.org
  2012-06-20  7:27 ` jason at gcc dot gnu.org
  2012-06-21  2:13 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-06-20  7:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-20 07:22:29 UTC ---
Author: jason
Date: Wed Jun 20 07:22:21 2012
New Revision: 188812

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188812
Log:
    PR c++/52637
    * dwarf2out.c (modified_type_die): Use scope_die_for.
    (gen_type_die_with_usage, dwarf2out_finish): Likewise.
    (uses_local_type_r, uses_local_type): New.
    (scope_die_for): Keep a type that uses a local type in local scope.
    Use get_context_die for namespace and type scope.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/debug/dwarf2/localclass3.C
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/debug/dwarf2/namespace-2.C
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/debug/localclass1.C
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/dwarf2out.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/52637] [4.7 regression] ICE producing debug info for c++11 code using local class as template argument
  2012-03-20 15:33 [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda scovich at gmail dot com
                   ` (5 preceding siblings ...)
  2012-06-20  7:22 ` jason at gcc dot gnu.org
@ 2012-06-20  7:27 ` jason at gcc dot gnu.org
  2012-06-21  2:13 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-06-20  7:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-20 07:22:29 UTC ---
Author: jason
Date: Wed Jun 20 07:22:21 2012
New Revision: 188812

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188812
Log:
    PR c++/52637
    * dwarf2out.c (modified_type_die): Use scope_die_for.
    (gen_type_die_with_usage, dwarf2out_finish): Likewise.
    (uses_local_type_r, uses_local_type): New.
    (scope_die_for): Keep a type that uses a local type in local scope.
    Use get_context_die for namespace and type scope.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/debug/dwarf2/localclass3.C
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/debug/dwarf2/namespace-2.C
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/debug/localclass1.C
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/dwarf2out.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-20 07:27:19 UTC ---
Author: jason
Date: Wed Jun 20 07:27:07 2012
New Revision: 188814

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188814
Log:
    PR c++/52637
    * g++.dg/debug/localclass1.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/debug/localclass1.C
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/52637] [4.7 regression] ICE producing debug info for c++11 code using local class as template argument
  2012-03-20 15:33 [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda scovich at gmail dot com
                   ` (6 preceding siblings ...)
  2012-06-20  7:27 ` jason at gcc dot gnu.org
@ 2012-06-21  2:13 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2012-06-21  2:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-21 02:13:10 UTC ---
Fixed for 4.7.2.


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

end of thread, other threads:[~2012-06-21  2:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20 15:33 [Bug c++/52637] New: ICE producing debug info for c++11 code using templates/decltype/lambda scovich at gmail dot com
2012-04-14 21:23 ` [Bug c++/52637] [4.7/4.8 regression] ICE producing debug info for c++11 code using local class as template argument jason at gcc dot gnu.org
2012-04-26 14:00 ` rguenth at gcc dot gnu.org
2012-04-26 14:14 ` rguenth at gcc dot gnu.org
2012-05-31 21:55 ` [Bug c++/52637] [4.7 " jason at gcc dot gnu.org
2012-06-14  8:14 ` rguenth at gcc dot gnu.org
2012-06-20  7:22 ` jason at gcc dot gnu.org
2012-06-20  7:27 ` jason at gcc dot gnu.org
2012-06-21  2:13 ` 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).