public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34846]  New: ICE on STL container iterator copy
@ 2008-01-18  5:33 dougkwan at google dot com
  2008-01-18  8:36 ` [Bug c++/34846] [4.3 regression] " ian at airs dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dougkwan at google dot com @ 2008-01-18  5:33 UTC (permalink / raw)
  To: gcc-bugs

My copy of top of trunk, which was updated today, ICEd with this piece of code:

------
#include <vector>                       // fails with vector and set

void
test()
{
  typedef int a;                        // must be locally defined
  std::vector<a*>::iterator x;          // element must be pointer to
                                        // aliased type
  std::vector<a*>::iterator y=x;
}
------


-- 
           Summary: ICE on STL container iterator copy
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dougkwan at google dot com
 GCC build triplet: i686-unknown-linux-gnu
  GCC host triplet: i686-unknown-linux-gnu
GCC target triplet: i686-unknown-linux-gnu


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


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

* [Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
  2008-01-18  5:33 [Bug c++/34846] New: ICE on STL container iterator copy dougkwan at google dot com
@ 2008-01-18  8:36 ` ian at airs dot com
  2008-01-18 11:35 ` rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ian at airs dot com @ 2008-01-18  8:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ian at airs dot com  2008-01-18 06:11 -------
Here is a standalone test case.

template<typename, typename> struct __are_same { enum { __value = 0 }; };
template<typename _Tp> struct __are_same<_Tp, _Tp> { enum { __value = 1 }; };
template<typename, bool> struct __enable_if { };
template<typename _Tp> struct __enable_if<_Tp, true> { typedef _Tp __type; };
template<typename _Iterator, typename _Container> class __normal_iterator {
public:
  __normal_iterator();
  template<typename _Iter>
  __normal_iterator(
    const __normal_iterator<_Iter, typename __enable_if<_Container,
(__are_same<_Iter, typename _Container::pointer>::__value) >::__type>& __i)
  { }
};
template<typename _Tp> class vector {
public:
  typedef _Tp* pointer;
  typedef __normal_iterator<int, vector<_Tp> > iterator;
};
void test() {
  typedef int t;
  vector<t*>::iterator x;
  vector<t*>::iterator y = x;
}


-- 

ian at airs dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
            Summary|ICE on STL container        |[4.3 regression] ICE on STL
                   |iterator copy               |container iterator copy


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


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

* [Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
  2008-01-18  5:33 [Bug c++/34846] New: ICE on STL container iterator copy dougkwan at google dot com
  2008-01-18  8:36 ` [Bug c++/34846] [4.3 regression] " ian at airs dot com
@ 2008-01-18 11:35 ` rguenth at gcc dot gnu dot org
  2008-01-19  8:26 ` dkwan at transmeta dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-18 11:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-01-18 09:33 -------
Looks related to PR34573.

Backtrace:

#0  0x00000000010bacb1 in htab_find_with_hash (htab=0x0, 
    element=0x2b899b95a300, hash=863155296)
    at /space/rguenther/src/svn/trunk/libiberty/hashtab.c:566
#1  0x000000000047b935 in retrieve_local_specialization (tmpl=0x2b899b95a300)
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:980
#2  0x00000000004bd664 in tsubst (t=0x2b899b95a3c0, args=0x2b899b95d8a0, 
    complain=tf_none, in_decl=0x0)
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:8859
#3  0x00000000004bd7a4 in tsubst (t=0x2b899b95a480, args=0x2b899b95d8a0, 
    complain=tf_none, in_decl=0x0)
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:8879
#4  0x00000000004bd7a4 in tsubst (t=0x2b899b95a840, args=0x2b899b95d8a0, 
    complain=tf_none, in_decl=0x0)
    at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:8879
...


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |34573
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-18 09:33:56
               date|                            |


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


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

* [Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
  2008-01-18  5:33 [Bug c++/34846] New: ICE on STL container iterator copy dougkwan at google dot com
  2008-01-18  8:36 ` [Bug c++/34846] [4.3 regression] " ian at airs dot com
  2008-01-18 11:35 ` rguenth at gcc dot gnu dot org
@ 2008-01-19  8:26 ` dkwan at transmeta dot com
  2008-01-20  4:51 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dkwan at transmeta dot com @ 2008-01-19  8:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dkwan at transmeta dot com  2008-01-19 03:33 -------
cc1plus SEG faults because the hash table local_specializations is NULL.  There
are calls to retrieve_local_specialization in pt.c. All but one, which caused
this ICE, are protected by a NULL test.  I have a sandbox with a trivial fix of
checking local_specializations before call retrieve_local_specialization. It
bootstrapped on i686-unknown-linux-gnu and I am now waiting for the regression
tests finish.  If everything looks fine, I will send that out to gcc-patches
tonight or tomorrow the latest.

(In reply to comment #2)
> Looks related to PR34573.
> 
> Backtrace:
> 
> #0  0x00000000010bacb1 in htab_find_with_hash (htab=0x0, 
>     element=0x2b899b95a300, hash=863155296)
>     at /space/rguenther/src/svn/trunk/libiberty/hashtab.c:566
> #1  0x000000000047b935 in retrieve_local_specialization (tmpl=0x2b899b95a300)
>     at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:980
> #2  0x00000000004bd664 in tsubst (t=0x2b899b95a3c0, args=0x2b899b95d8a0, 
>     complain=tf_none, in_decl=0x0)
>     at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:8859
> #3  0x00000000004bd7a4 in tsubst (t=0x2b899b95a480, args=0x2b899b95d8a0, 
>     complain=tf_none, in_decl=0x0)
>     at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:8879
> #4  0x00000000004bd7a4 in tsubst (t=0x2b899b95a840, args=0x2b899b95d8a0, 
>     complain=tf_none, in_decl=0x0)
>     at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:8879
> ...
> 


-- 


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


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

* [Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
  2008-01-18  5:33 [Bug c++/34846] New: ICE on STL container iterator copy dougkwan at google dot com
                   ` (2 preceding siblings ...)
  2008-01-19  8:26 ` dkwan at transmeta dot com
@ 2008-01-20  4:51 ` pinskia at gcc dot gnu dot org
  2008-01-21 16:55 ` jsm28 at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-20  4:51 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.3.0


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


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

* [Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
  2008-01-18  5:33 [Bug c++/34846] New: ICE on STL container iterator copy dougkwan at google dot com
                   ` (3 preceding siblings ...)
  2008-01-20  4:51 ` pinskia at gcc dot gnu dot org
@ 2008-01-21 16:55 ` jsm28 at gcc dot gnu dot org
  2008-01-21 23:17 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-01-21 16:55 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
  2008-01-18  5:33 [Bug c++/34846] New: ICE on STL container iterator copy dougkwan at google dot com
                   ` (4 preceding siblings ...)
  2008-01-21 16:55 ` jsm28 at gcc dot gnu dot org
@ 2008-01-21 23:17 ` jason at gcc dot gnu dot org
  2008-01-22 14:52 ` jason at gcc dot gnu dot org
  2008-01-22 15:52 ` jakub at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-01-21 23:17 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-01-18 09:33:56         |2008-01-21 23:00:40
               date|                            |


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


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

* [Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
  2008-01-18  5:33 [Bug c++/34846] New: ICE on STL container iterator copy dougkwan at google dot com
                   ` (5 preceding siblings ...)
  2008-01-21 23:17 ` jason at gcc dot gnu dot org
@ 2008-01-22 14:52 ` jason at gcc dot gnu dot org
  2008-01-22 15:52 ` jakub at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-01-22 14:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jason at gcc dot gnu dot org  2008-01-22 14:48 -------
Subject: Bug 34846

Author: jason
Date: Tue Jan 22 14:48:05 2008
New Revision: 131724

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131724
Log:
        PR c++/33959
        * pt.c (tsubst_aggr_type): Make sure our context is complete.

        PR c++/34573
        * pt.c (retrieve_local_specialization): Robustify.
        (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.

        PR c++/34846
        * pt.c (tsubst): Only call retrieve_local_specialization if the
        original typedef was in a function template.

Added:
    trunk/gcc/testsuite/g++.dg/template/nested5.C
    trunk/gcc/testsuite/g++.dg/template/typedef10.C
    trunk/gcc/testsuite/g++.dg/template/typedef9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c


-- 


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


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

* [Bug c++/34846] [4.3 regression] ICE on STL container iterator copy
  2008-01-18  5:33 [Bug c++/34846] New: ICE on STL container iterator copy dougkwan at google dot com
                   ` (6 preceding siblings ...)
  2008-01-22 14:52 ` jason at gcc dot gnu dot org
@ 2008-01-22 15:52 ` jakub at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-01-22 15:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2008-01-22 14:56 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-01-22 14:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-18  5:33 [Bug c++/34846] New: ICE on STL container iterator copy dougkwan at google dot com
2008-01-18  8:36 ` [Bug c++/34846] [4.3 regression] " ian at airs dot com
2008-01-18 11:35 ` rguenth at gcc dot gnu dot org
2008-01-19  8:26 ` dkwan at transmeta dot com
2008-01-20  4:51 ` pinskia at gcc dot gnu dot org
2008-01-21 16:55 ` jsm28 at gcc dot gnu dot org
2008-01-21 23:17 ` jason at gcc dot gnu dot org
2008-01-22 14:52 ` jason at gcc dot gnu dot org
2008-01-22 15:52 ` jakub 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).