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
|
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
State-Changed-From-To: open->analyzed
State-Changed-Why: Giovanni analyzed this.
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
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3 and trunk.