[Bug optimization/14863] [3.4/3.5 regression] unit-at-a-time causes miscompilation
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Apr 7 13:07:00 GMT 2004
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-07 13:06 -------
Here is the backtrace I get with the mainline at -O1 -g -funit-at-a-time --param large-function-
insns=3000:
#0 0x4207af5c in chunk_free () from /lib/i686/libc.so.6
#1 0x4207acb4 in free () from /lib/i686/libc.so.6
#2 0x400bf761 in operator delete (ptr=0x4212e0f0)
at /home/gates/pinskia/src/gnu/gcc/src/libstdc++-v3/libsupc++/del_op.cc:39
#3 0x0805faa3 in ~PatchSwapLayout (this=0xbffec080) at pr14863.cc:9943 <-- not right function
name
#4 0x080539ff in main (argc=1, argv=0xbffec194) at pr14863.cc:52762
I think this is related to some pointer :
char *tmp = new char[nsize];
pBeginNew = reinterpret_cast<T *>(tmp);
char *tmp = reinterpret_cast<char *>(pBegin_m);
delete [] tmp; <--- crashing here
I do not understand why the code is doing this though as you should be just using new T[newsize]
instead. The other thing is that you could be over running the buffer which could cause this problem.
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[3.4 regression] unit-at-a- |[3.4/3.5 regression] unit-
|time causes miscompilation |at-a-time causes
| |miscompilation
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14863
More information about the Gcc-bugs
mailing list