🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #2080

delete[] bug?

#2080
From: Ron Reisor
Date: Thu, 08 Jun 1989 13:59
49 lines
1325 bytes
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
Technical Details
Message-ID: <3778@udccvax1.acs.udel.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!rutgers!rochester!udel!udccvax1!ron

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!rutgers!rochester!udel!udccvax1!ron
From: ron@vax1.acs.udel.EDU (Ron Reisor)
Newsgroups: gnu.g++.bug
Subject: delete[] bug?
Message-ID: <3778@udccvax1.acs.udel.EDU>
Date: 8 Jun 89 13:59:21 GMT
Reply-To: ron@vax1.acs.udel.EDU (Ron Reisor)
Organization: University of Delaware
Lines: 49