Bug 9429 - [3.2 regression] ICE in template instantiation with a pointered new operator
Bug#: 9429 Product:  gcc Version: 3.2.2
Host:  Target:  Build: 
Status: RESOLVED Severity: normal Priority: P3
Resolution: FIXED Assigned To: unassigned@gcc.gnu.org Reported By: t-gcc@snowelm.com
Component: c++ Target Milestone: ---
Summary: [3.2 regression] ICE in template instantiation with a pointered new operator
Keywords:  ice-on-valid-code
Opened: 2003-01-24 09:56
Description:   Last confirmed: Opened: 2003-01-24 09:56
The attached code causes ICE on GCC version 3.2.2 (it seems GCC 3.2 20020927
has the same problem). GCC  2.95.4 compiles the same source perfectly (if you
use the non-preprocessed code), so I believe the code is legal...
---------------
$ g++ -O0 array.ii
array.h: In member function `ARRAYBASE*
   ArrayMakerKeyTemplate<ARRAYBASE>::MakeEntry(ARRAYBASE::hashkey_t) [with
   ARRAYBASE = ArrayEntry<ulong>]':
hash.h:546:   instantiated from here
array.h:215: Internal compiler error in convert_from_eh_region_ranges_1, at
   except.c:1404
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.2/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.2 20030109 (Debian prerelease)
---------------

Release:
gcc version 3.2.2 20030109 (Debian prerelease) i386-linux

Environment:
Debian GNU/Linux with kernel updated to 2.4.20

How-To-Repeat:
Compile the attached file:
g++ -O0 array.ii

------- Comment #1 From Wolfgang Bangerth 2003-01-24 15:06 -------
State-Changed-From-To: open->analyzed
State-Changed-Why: Giovanni analyzed this.

------- Comment #2 From Giovanni Bajo 2003-01-24 15:45 -------
From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<t-gcc@snowelm.com>
Cc:  
Subject: Re: c++/9429: ICE in template instantiation with a pointered new operator
Date: Fri, 24 Jan 2003 15:45:32 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=9429
 
 Reduced snippet:
 ------------------------
 struct B
 {
  ~B() throw() {}
 
  void* foo(void)
  { return 0; }
 };
 
 void* operator new(unsigned int, void* __p) { return __p; }
 void operator delete (void*, void*) { };
 
 void A(void)
 {
  (void)new (B().foo()) int();
 }
 
 ------------------------
 ice5.cpp: In function `void A()':
 ice5.cpp:15: Internal compiler error in convert_from_eh_region_ranges_1, at
 except.c:1404
 Please submit a full bug report,
 
 GCC is confused by a temporary with exception specification in destructor
 created within a placement-new expression. For the submitter, the easy fix
 is to modify all the Array*Template<>::MakeEntry() so that the temporary is
 created at function scope instead of within the placement new.
 
 Giovanni Bajo
 

------- Comment #3 From Wolfgang Bangerth 2003-04-07 09:00 -------
From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: Giovanni Bajo <giovannibajo@libero.it>
Cc: gcc-gnats@gcc.gnu.org, <gcc-bugs@gcc.gnu.org>, <nobody@gcc.gnu.org>,
   <gcc-prs@gcc.gnu.org>, <t-gcc@snowelm.com>
Subject: Re: c++/9429: ICE in template instantiation with a pointered new
 operator
Date: Mon, 7 Apr 2003 09:00:12 -0500 (CDT)

 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9429
 > 
 > Fixed in GCC 3.3 20030401, and worked on 2.95. If it's fixed in 3.4, it
 > should be marked as 3.2 regression.
 
 Indeed fixed in 3.4.
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
 
 

------- Comment #4 From Giovanni Bajo 2003-04-07 12:48 -------
From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<t-gcc@snowelm.com>
Cc: "Wolfgang Bangerth" <bangerth@ices.utexas.edu>
Subject: Re: c++/9429: ICE in template instantiation with a pointered new operator
Date: Mon, 7 Apr 2003 12:48:12 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=9429
 
 Fixed in GCC 3.3 20030401, and worked on 2.95. If it's fixed in 3.4, it
 should be marked as 3.2 regression. Otherwise, it's a 3.2/3.4 regression (I
 can't test on 3.4 since it's still broken for cygwin target).
 
 Giovanni Bajo
 


------- Comment #5 From Joe Buck 2003-04-25 19:32 -------
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3 and trunk.