public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42634]  New: ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
@ 2010-01-06 14:13 wouter dot vermaelen at scarlet dot be
  2010-01-06 16:30 ` [Bug c++/42634] " rguenth at gcc dot gnu dot org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: wouter dot vermaelen at scarlet dot be @ 2010-01-06 14:13 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]

> cat bug.ii

template<typename T> T declval();
template<typename T, typename... Args> struct is_constructible {
        template<typename T1, typename... Args1>
                static decltype(T1(declval<Args1>()...), char()) test();
        static const bool value = sizeof(test<T, Args...>()) == 1;
};
template<bool> struct enable_if {
        typedef void type;
};
template<class T1, class T2> struct pair {
        template<class U2,
                 class = typename enable_if<is_constructible<T2,
U2&&>::value>::type>
        pair(const T1&, U2&&) { }
};
struct string {
        string() : p(0) {}
        char* p;
};
struct Foo {
          string s;
          int i;
};
void f() {
        pair<int, Foo>(1, Foo());
}


> g++ -g -O2 -std=c++0x bug.ii
bug.ii: In instantiation of ‘const bool is_constructible<Foo, int&&>::value’:
bug.ii:24:26:   instantiated from here
bug.ii:5:58: internal compiler error: in copy_fn_p, at cp/decl.c:9973


I'm using SVN revision trunk@155658 on linux x86_64.


-- 
           Summary: ICE with -g -O2 -std=c++0x   in copy_fn_p, at
                    cp/decl.c:9973
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wouter dot vermaelen at scarlet dot be


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
@ 2010-01-06 16:30 ` rguenth at gcc dot gnu dot org
  2010-01-06 22:50 ` bkoz at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-06 16:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2010-01-06 16:30 -------
Confirmed.  Older releases ICE differently.

Note that I don't see an ICE with -g0 but only with -g.

With plain -g the code is even rejected:

> ./cc1plus -quiet -std=c++0x t.ii
ok
> ./cc1plus -quiet -std=c++0x t.ii -g
t.ii: In instantiation of 'const bool is_constructible<Foo, int&&>::value':
t.ii:14:30:   instantiated from here
t.ii:5:61: error: no matching function for call to 'is_constructible<Foo,
int&&>::test()'
t.ii:14:30: error: 'is_constructible<Foo, int&&>::value' is not a valid
template argument for type 'bool' because it is a non-constant expression
t.ii: In constructor 'pair<T1, T2>::pair(const T1&, U2&&) [with U2 = Foo,
<template-parameter-2-2> = void, T1 = int, T2 = Foo]':
t.ii:14:30: error: 'is_constructible<Foo, int&&>::value' is not a valid
template argument for type 'bool' because it is a non-constant expression


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code, rejects-
                   |                            |valid
      Known to fail|                            |4.3.4 4.4.2 4.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-06 16:30:39
               date|                            |


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
  2010-01-06 16:30 ` [Bug c++/42634] " rguenth at gcc dot gnu dot org
@ 2010-01-06 22:50 ` bkoz at gcc dot gnu dot org
  2010-01-06 22:51 ` bkoz at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2010-01-06 22:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bkoz at gcc dot gnu dot org  2010-01-06 22:49 -------
*** Bug 42639 has been marked as a duplicate of this bug. ***


-- 

bkoz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bkoz at gcc dot gnu dot org


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
  2010-01-06 16:30 ` [Bug c++/42634] " rguenth at gcc dot gnu dot org
  2010-01-06 22:50 ` bkoz at gcc dot gnu dot org
@ 2010-01-06 22:51 ` bkoz at gcc dot gnu dot org
  2010-01-07 20:07 ` dodji at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2010-01-06 22:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from bkoz at gcc dot gnu dot org  2010-01-06 22:50 -------

Running into this as well. 


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (2 preceding siblings ...)
  2010-01-06 22:51 ` bkoz at gcc dot gnu dot org
@ 2010-01-07 20:07 ` dodji at gcc dot gnu dot org
  2010-01-09 19:59 ` dodji at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-07 20:07 UTC (permalink / raw)
  To: gcc-bugs



-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dodji at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-01-06 16:30:39         |2010-01-07 20:07:22
               date|                            |


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (3 preceding siblings ...)
  2010-01-07 20:07 ` dodji at gcc dot gnu dot org
@ 2010-01-09 19:59 ` dodji at gcc dot gnu dot org
  2010-01-12 13:40 ` doko at ubuntu dot com
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-09 19:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dodji at gcc dot gnu dot org  2010-01-09 19:58 -------
I posted a candidate patch to
http://gcc.gnu.org/ml/gcc-patches/2010-01/msg00449.html


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (4 preceding siblings ...)
  2010-01-09 19:59 ` dodji at gcc dot gnu dot org
@ 2010-01-12 13:40 ` doko at ubuntu dot com
  2010-01-13 20:07 ` dodji at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: doko at ubuntu dot com @ 2010-01-12 13:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from doko at ubuntu dot com  2010-01-12 13:39 -------
Created an attachment (id=19547)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19547&action=view)
preprocessed source

the attached testcase builds with the 4.4 branch, but not with 4.5. lowering
optimization to -O1 works around the build failure.

$ g++ -g -O2 -std=c++0x -c file_lie.ii 
In file included from /usr/include/c++/4.5/bits/move.h:38:0,
                 from /usr/include/c++/4.5/bits/stl_pair.h:60,
                 from /usr/include/c++/4.5/utility:71,
                 from /usr/include/c++/4.5/unordered_map:42,
                 from file_lie.cpp:22:
/usr/include/c++/4.5/type_traits: In instantiation of 'const bool
std::__is_constructible_helper<stat_override, override_key&&>::__value':
/usr/include/c++/4.5/type_traits:235:5:   instantiated from
'std::is_constructible<stat_override, override_key&&>'
/usr/include/c++/4.5/bits/stl_pair.h:257:49:   instantiated from here
/usr/include/c++/4.5/type_traits:224:67: internal compiler error: in copy_fn_p,
at cp/decl.c:9973
Please submit a full bug report,
with preprocessed source if appropriate.


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (5 preceding siblings ...)
  2010-01-12 13:40 ` doko at ubuntu dot com
@ 2010-01-13 20:07 ` dodji at gcc dot gnu dot org
  2010-01-13 20:08 ` dodji at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-13 20:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dodji at gcc dot gnu dot org  2010-01-13 20:06 -------
Subject: Bug 42634

Author: dodji
Date: Wed Jan 13 20:06:26 2010
New Revision: 155868

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155868
Log:
Fix PR c++/42634

gcc/cp/ChangeLog:
        PR c++/42634
        * error.c (dump_template_parms): Use innermost template
        arguments before calling count_non_default_template_args.
        (count_non_default_template_args): We are being called with
        template innermost arguments now. There is no need to ensure
        that again.

gcc/testsuite/ChangeLog:
        PR c++/42634
        * g++.dg/template/error45.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/error45.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/error.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (6 preceding siblings ...)
  2010-01-13 20:07 ` dodji at gcc dot gnu dot org
@ 2010-01-13 20:08 ` dodji at gcc dot gnu dot org
  2010-01-15 11:24 ` dodji at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-13 20:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dodji at gcc dot gnu dot org  2010-01-13 20:08 -------
Fixed in 4.5


-- 

dodji at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (7 preceding siblings ...)
  2010-01-13 20:08 ` dodji at gcc dot gnu dot org
@ 2010-01-15 11:24 ` dodji at gcc dot gnu dot org
  2010-01-15 11:29 ` dodji at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-15 11:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dodji at gcc dot gnu dot org  2010-01-15 11:23 -------
Subject: Bug 42634

Author: dodji
Date: Fri Jan 15 11:23:29 2010
New Revision: 155936

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155936
Log:
Revert commit of PR c++/42634, which was commit r155868

Removed:
    trunk/gcc/testsuite/g++.dg/template/error45.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/error.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (8 preceding siblings ...)
  2010-01-15 11:24 ` dodji at gcc dot gnu dot org
@ 2010-01-15 11:29 ` dodji at gcc dot gnu dot org
  2010-01-18 10:08 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-15 11:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dodji at gcc dot gnu dot org  2010-01-15 11:29 -------
Re-opening, as the fix was reverted.


-- 

dodji at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (9 preceding siblings ...)
  2010-01-15 11:29 ` dodji at gcc dot gnu dot org
@ 2010-01-18 10:08 ` rguenth at gcc dot gnu dot org
  2010-01-18 11:24 ` dodji at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-18 10:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2010-01-18 10:07 -------
I'm running into this as well, but with code that clearly compiled fine with
gcc 4.4.  So maybe it's a slightly different issue.


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (10 preceding siblings ...)
  2010-01-18 10:08 ` rguenth at gcc dot gnu dot org
@ 2010-01-18 11:24 ` dodji at gcc dot gnu dot org
  2010-01-18 21:19 ` dodji at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-18 11:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from dodji at gcc dot gnu dot org  2010-01-18 11:24 -------
It looks like the fix for PR42761 made the previous fix for this one (the one I
reverted) acceptable now.

I am waiting for Jason's comment at

http://gcc.gnu.org/ml/gcc-patches/2010-01/msg00964.html


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (11 preceding siblings ...)
  2010-01-18 11:24 ` dodji at gcc dot gnu dot org
@ 2010-01-18 21:19 ` dodji at gcc dot gnu dot org
  2010-01-18 23:14 ` dodji at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-18 21:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from dodji at gcc dot gnu dot org  2010-01-18 21:19 -------
Subject: Bug 42634

Author: dodji
Date: Mon Jan 18 21:18:49 2010
New Revision: 156022

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156022
Log:
Fix PR c++/42634

gcc/cp/ChangeLog:
    PR c++/42634
    * error.c (dump_template_parms): Use innermost template
    arguments before calling count_non_default_template_args.
    (count_non_default_template_args): We are being called with
    template innermost arguments now. There is no need to ensure
    that again.

gcc/testsuite/ChangeLog:
    PR c++/42634
    * g++.dg/template/error45.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/error45.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/error.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (12 preceding siblings ...)
  2010-01-18 21:19 ` dodji at gcc dot gnu dot org
@ 2010-01-18 23:14 ` dodji at gcc dot gnu dot org
  2010-01-19 15:39 ` dodji at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-18 23:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from dodji at gcc dot gnu dot org  2010-01-18 23:14 -------
Subject: Bug 42634

Author: dodji
Date: Mon Jan 18 23:14:01 2010
New Revision: 156026

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156026
Log:
Revert fix of PR c++/

gcc/cp/ChangeLog:
        * error.c (dump_template_parms, count_non_default_template_args):
        Revert fix of PR c++/42634.

gcc/testsuite/ChangeLog:
        * g++.dg/template/error45.C: reverted as part of reverting the
        fix of PR c++/42634.

Removed:
    trunk/gcc/testsuite/g++.dg/template/error45.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/error.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (13 preceding siblings ...)
  2010-01-18 23:14 ` dodji at gcc dot gnu dot org
@ 2010-01-19 15:39 ` dodji at gcc dot gnu dot org
  2010-01-29 14:31 ` dodji at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-19 15:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from dodji at gcc dot gnu dot org  2010-01-19 15:39 -------
Created an attachment (id=19656)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19656&action=view)
candidate fix

I am testing this fix.
I think one residual issue that was left to fix in the revert patch was that
count_non_default_template_args is triggering some class type instantiation on
the new std::bind related code, but it shouldn't. This patch tries to avoid
that. But I'll sleep on it a bit. I have been bitten by it enough :-)


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (14 preceding siblings ...)
  2010-01-19 15:39 ` dodji at gcc dot gnu dot org
@ 2010-01-29 14:31 ` dodji at gcc dot gnu dot org
  2010-01-29 16:07 ` dodji at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-29 14:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from dodji at gcc dot gnu dot org  2010-01-29 14:31 -------
Subject: Bug 42634

Author: dodji
Date: Fri Jan 29 14:30:41 2010
New Revision: 156351

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156351
Log:
Fix PRs c++/42758, c++/42634, c++/42797

... and mitigate PR c++/42336

gcc/cp/ChangeLog:
        PR c++/42758
        PR c++/42634
        PR c++/42336
        PR c++/42797
        PR c++/42880
        * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
        SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
        GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
        * pt.c (coerce_template_parms, type_unification_real,
        expand_template_argument_pack, coerce_template_parameter_pack):
        Set the non default template args count.
        (current_template_args): Always set non defaulted
        template args count when compiled with --enable-checking
        (tsubst_template_args, type_unification_real): Propagate the non
        defaulted template args count.
        * error.c (get_non_default_template_args_count): Renamed
        count_non_default_template_args into this. Don't calculate the
        non default template argument count anymore. Use the new
        accessor macros above to get it.
        (dump_template_argument_list, dump_type, dump_decl,
        dump_template_parms): Adjust.
        * parser.c (cp_parser_template_argument_list): Always set defaulted
        template args count when compiled with --enable-checking.

gcc/testsuite/ChangeLog:
        PR c++/42758
        PR c++/42634
        PR c++/42336
        PR c++/42797
        PR c++/42880
        * g++.dg/other/crash-5.C: New test.
        * g++.dg/other/crash-6.C: New test.
        * g++.dg/other/crash-7.C: New test.
        * g++.dg/other/crash-8.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/other/crash-5.C
    trunk/gcc/testsuite/g++.dg/other/crash-6.C
    trunk/gcc/testsuite/g++.dg/other/crash-7.C
    trunk/gcc/testsuite/g++.dg/other/crash-8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/error.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (15 preceding siblings ...)
  2010-01-29 14:31 ` dodji at gcc dot gnu dot org
@ 2010-01-29 16:07 ` dodji at gcc dot gnu dot org
  2010-02-07  3:56 ` hjl dot tools at gmail dot com
  2010-02-07  4:47 ` hjl at gcc dot gnu dot org
  18 siblings, 0 replies; 20+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-01-29 16:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from dodji at gcc dot gnu dot org  2010-01-29 16:07 -------
Hopefully fixed in 4.5 (trunk) now.


-- 

dodji at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (16 preceding siblings ...)
  2010-01-29 16:07 ` dodji at gcc dot gnu dot org
@ 2010-02-07  3:56 ` hjl dot tools at gmail dot com
  2010-02-07  4:47 ` hjl at gcc dot gnu dot org
  18 siblings, 0 replies; 20+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-02-07  3:56 UTC (permalink / raw)
  To: gcc-bugs



-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

* [Bug c++/42634] ICE with -g -O2 -std=c++0x   in copy_fn_p, at cp/decl.c:9973
  2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
                   ` (17 preceding siblings ...)
  2010-02-07  3:56 ` hjl dot tools at gmail dot com
@ 2010-02-07  4:47 ` hjl at gcc dot gnu dot org
  18 siblings, 0 replies; 20+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-02-07  4:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from hjl at gcc dot gnu dot org  2010-02-07 04:43 -------
Subject: Bug 42634

Author: hjl
Date: Sun Feb  7 04:41:22 2010
New Revision: 156562

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156562
Log:
Backport testcases from mainline to 4.4.

2010-02-06  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2010-02-05  Dodji Seketeli  <dodji@redhat.com>

        PR c++/42915
        * g++.dg/other/crash-9.C: New test.

        2010-02-03  Jason Merrill  <jason@redhat.com>

        PR c++/40138
        * g++.dg/ext/builtin11.C: New.

        2010-02-03  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/42944
        * gcc.dg/errno-1.c: New testcase.

        2010-02-03  Richard Guenther  <rguenther@suse.de>

        PR middle-end/42927
        * gcc.c-torture/compile/pr42927.c: New testcase.

        2010-01-29  Dodji Seketeli  <dodji@redhat.com>

        PR c++/42758
        PR c++/42634
        PR c++/42336
        PR c++/42797
        PR c++/42880
        * g++.dg/other/crash-5.C: New test.
        * g++.dg/other/crash-7.C: New test.
        * g++.dg/other/crash-8.C: New test.

        2010-01-28  Uros Bizjak  <ubizjak@gmail.com>

        PR target/42891
        * gcc.target/i386/pr42891.c: New test.

        2010-01-28  Richard Guenther  <rguenther@suse.de>

        PR middle-end/42883
        * g++.dg/torture/pr42883.C: New testcase.

        2010-01-28  Michael Matz  <matz@suse.de>

        * gcc.target/i386/pr42881.c: New test.

        2010-01-28  Dodji Seketeli  <dodji@redhat.com>

        PR c++/42713
        PR c++/42820
        * g++.dg/template/typedef27.C: New test case.
        * g++.dg/template/typedef28.C: New test case.

        2010-01-27  Jakub Jelinek  <jakub@redhat.com>

        PR middle-end/42874
        * gcc.dg/vla-22.c: New test.

        2010-01-26  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/42250
        * gcc.dg/pr42250.c: New testcase.

        2010-01-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/42858
        * gfortran.dg/generic_21.f90: New test.

        2010-01-21  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/42585
        * gcc.dg/tree-ssa/pr42585.c: New test.

        2010-01-20  Alexandre Oliva  <aoliva@redhat.com>

        PR debug/42715
        * gcc.dg/pr42715.c: New.

        2010-01-20  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/42717
        * gcc.c-torture/compile/pr42717.c: New testcase.

        2010-01-19  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/42783
        * gfortran.dg/bounds_check_15.f90 : New test.

        2010-01-18  Dodji Seketeli  <dodji@redhat.com>

        PR c++/42766
        * g++.dg/conversion/op6.C: New test.

        2010-01-18  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/42781
        * gfortran.fortran-torture/compile/pr42781.f90: New testcase.

        2010-01-17  Richard Guenther  <rguenther@suse.de>

        PR middle-end/42248
        * gcc.c-torture/execute/pr42248.c: New testcase.

        2010-01-17  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/42677
        * gfortran.dg/interface_assignment_5.f90: New test.

        2010-01-15  Richard Guenther  <rguenther@suse.de>

        PR middle-end/42739
        * g++.dg/torture/pr42739.C: New testcase.

        2010-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>

        PR fortran/42684
        * gfortran.dg/interface_31.f90: New test.

        2010-01-14  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/42706
        * gcc.dg/ipa/pr42706.c: New testcase.

        2010-01-14  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/42714
        * g++.dg/torture/pr42714.C: New test.

        2010-01-14  Alexander Monakov  <amonakov@ispras.ru>

        PR rtl-optimization/42388
        * gcc.dg/pr42388.c: New.

        2010-01-14  Alexander Monakov <amonakov@ispras.ru>

        PR rtl-optimization/42294
        * gfortran.dg/pr42294.f: New.

        2010-01-14  Ira Rosen  <irar@il.ibm.com>

        PR tree-optimization/42709
        * gcc.dg/vect/pr42709.c: New test.

        2010-01-13  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/42730
        * gcc.c-torture/compile/pr42730.c: New testcase.

        2010-01-13  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/42704
        * g++.dg/torture/pr42704.C: New test.

        2010-01-13  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/42703
        * gcc.c-torture/compile/pr42703.c: New test.

        2010-01-13  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/42705
        * gcc.c-torture/compile/pr42705.c: New testcase.

        2010-01-13  Richard Guenther  <rguenther@suse.de>

        PR middle-end/42716
        * gcc.c-torture/compile/pr42716.c: New testcase.

        2010-01-12  Joseph Myers  <joseph@codesourcery.com>

        PR c/42708
        * gcc.c-torture/compile/pr42708-1.c: New test.

        2010-01-09  Alexandre Oliva  <aoliva@redhat.com>

        PR middle-end/42363
        * gcc.dg/torture/pr42363.c: New.

        2010-01-09  Alexandre Oliva  <aoliva@redhat.com>

        PR debug/42604
        PR debug/42395
        * gcc.dg/vect/pr42604.c: New.
        * gcc.dg/vect/pr42395.c: New.

        2010-01-09  Richard Guenther  <rguenther@suse.de>

        PR middle-end/42512
        * gcc.c-torture/execute/pr42512.c: New testcase.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/conversion/op6.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/conversion/op6.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ext/builtin11.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/ext/builtin11.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/crash-5.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/other/crash-5.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/crash-7.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/other/crash-7.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/crash-8.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/other/crash-8.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/crash-9.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/other/crash-9.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/typedef27.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/template/typedef27.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/typedef28.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/template/typedef28.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42704.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/torture/pr42704.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42714.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/torture/pr42714.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42739.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/torture/pr42739.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42883.C
      - copied unchanged from r156561,
trunk/gcc/testsuite/g++.dg/torture/pr42883.C
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42703.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42703.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42705.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42705.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42708-1.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42708-1.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42716.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42716.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42717.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42717.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42730.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42730.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42927.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42927.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr42248.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.c-torture/execute/pr42248.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr42512.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.c-torture/execute/pr42512.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/errno-1.c
      - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/errno-1.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/ipa/pr42706.c
      - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/ipa/pr42706.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42250.c
      - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/pr42250.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42388.c
      - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/pr42388.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr42715.c
      - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/pr42715.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr42363.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.dg/torture/pr42363.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/pr42395.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.dg/vect/pr42395.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/pr42604.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.dg/vect/pr42604.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/pr42709.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.dg/vect/pr42709.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vla-22.c
      - copied unchanged from r156561, trunk/gcc/testsuite/gcc.dg/vla-22.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42881.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.target/i386/pr42881.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr42891.c
      - copied unchanged from r156561,
trunk/gcc/testsuite/gcc.target/i386/pr42891.c
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/bounds_check_15.f90
      - copied unchanged from r156561,
trunk/gcc/testsuite/gfortran.dg/bounds_check_15.f90
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/generic_21.f90
      - copied unchanged from r156561,
trunk/gcc/testsuite/gfortran.dg/generic_21.f90
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/interface_31.f90
      - copied unchanged from r156561,
trunk/gcc/testsuite/gfortran.dg/interface_31.f90
   
branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/interface_assignment_5.f90
      - copied unchanged from r156561,
trunk/gcc/testsuite/gfortran.dg/interface_assignment_5.f90
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pr42294.f
      - copied unchanged from r156561,
trunk/gcc/testsuite/gfortran.dg/pr42294.f
   
branches/gcc-4_4-branch/gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90
      - copied unchanged from r156561,
trunk/gcc/testsuite/gfortran.fortran-torture/compile/pr42781.f90
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2010-02-07  4:47 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-06 14:13 [Bug c++/42634] New: ICE with -g -O2 -std=c++0x in copy_fn_p, at cp/decl.c:9973 wouter dot vermaelen at scarlet dot be
2010-01-06 16:30 ` [Bug c++/42634] " rguenth at gcc dot gnu dot org
2010-01-06 22:50 ` bkoz at gcc dot gnu dot org
2010-01-06 22:51 ` bkoz at gcc dot gnu dot org
2010-01-07 20:07 ` dodji at gcc dot gnu dot org
2010-01-09 19:59 ` dodji at gcc dot gnu dot org
2010-01-12 13:40 ` doko at ubuntu dot com
2010-01-13 20:07 ` dodji at gcc dot gnu dot org
2010-01-13 20:08 ` dodji at gcc dot gnu dot org
2010-01-15 11:24 ` dodji at gcc dot gnu dot org
2010-01-15 11:29 ` dodji at gcc dot gnu dot org
2010-01-18 10:08 ` rguenth at gcc dot gnu dot org
2010-01-18 11:24 ` dodji at gcc dot gnu dot org
2010-01-18 21:19 ` dodji at gcc dot gnu dot org
2010-01-18 23:14 ` dodji at gcc dot gnu dot org
2010-01-19 15:39 ` dodji at gcc dot gnu dot org
2010-01-29 14:31 ` dodji at gcc dot gnu dot org
2010-01-29 16:07 ` dodji at gcc dot gnu dot org
2010-02-07  3:56 ` hjl dot tools at gmail dot com
2010-02-07  4:47 ` hjl at gcc dot gnu dot 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).