ron@vax1.acs.udel.EDU (Ron Reisor) (06/08/89)
g++ 1.35.1- does not seem to be generating any code for the delete[] construct.
I wrote this small test program:
int *x;
main()
{
x = new int[10];
delete[10] x;
}
Then I compiled with g++:
g++ -v -S -O t.cc
g++ version 1.35.1-
/usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc6800
0 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__OPTIMIZE__ -Dmc68020 t.cc
/tmp/cca01781.cpp
GNU CPP version 1.35
/usr/local/lib/gcc-cc1plus /tmp/cca01781.cpp -quiet -dumpbase t.cc -opt -versio
n -o t.s
GNU C++ version 1.35.1- (68k, MIT syntax) compiled by GNU C version 1.35.
This is the resulting code generated:
#NO_APP
gcc_compiled.:
.text
.even
.globl _main
_main:
link a6,#0
pea 40:w
jbsr ___builtin_new
movel d0,_x
unlk a6
rts
.comm _x,4
If I don't subscript the type when calling new or the delete operator,
___builtin_delete does get called.
cheers,
Ron