This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11835] New: Subject: g++ 3.3 loops using all virtual memory with unusual 'new' statement
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Aug 2003 17:03:30 -0000
- Subject: [Bug c++/11835] New: Subject: g++ 3.3 loops using all virtual memory with unusual 'new' statement
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11835
Summary: Subject: g++ 3.3 loops using all virtual memory with
unusual 'new' statement
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pdubuc at cas dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: sparc-sun-solaris2.8
GCC host triplet: sparc-sun-solaris2.8
GCC target triplet: sparc-sun-solaris2.8
This bug is simlar to #11282 in the GCC Bugzilla database, but It may have a
different cause. The following program causes g++ 3.3 to loop (with no
error or warning messages) using up all virtual memory.
int
main()
{
int i = 16;
char* heap_area = new char [i]();
}
Is line 5 valid C++ with the parens? I've never see new called this way, but
it compiled fine with g++ 2.95.3. If the parens are valid, what do they mean?
With g++ 3.2.3 I get the following error:
z.cc: In function `int main()':
z.cc:5: variable-sized object of type `char[i]' may not be initialized
With 3.3 the code compiles fine when the parens are removed from line 5 or if a literal constant is used in place of 'i'.
Environment:
System: SunOS pmd24awu 5.8 Generic_108528-16 sun4u sparc SUNW,Sun-Blade-100
Architecture: sun4
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.3/configure --prefix=/vol/gnu/gcc-3.3 --enable-shared --enable-threads --enable-cpp --enable-languages=c++ --with-gnu-as --with-as=/vol/gnu/gcc-3.3/bin/as --with-gnu-ld --with-ld=/vol/gnu/gcc-3.3/bin/ld --host=sparc-sun-solaris2.8
How-To-Repeat:
See Description.
------- Additional Comments From pdubuc at cas dot org 2003-08-06 17:03 -------
Fix:
See Description.