[Bug c++/91434] gcc optimization behaviour is inconsistent with -O2 with 4.1.2 and 4.9.4
marxin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Aug 13 11:27:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91434
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |marxin at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
If I see correctly, you're attempting to do a double-free:
$ g++ pr91434.cpp -fsanitize=address -g -O2 && ./a.out
FSPGI ctor1
FSPI ctor
FSPG ctor
FSPGI ctor
FSPGI dtor
m_g is not NULL
FSPG dtor
FSPI dtor
FSPGI dtor
m_g is not NULL
FSPG dtor
=================================================================
==11968==ERROR: AddressSanitizer: attempting double-free on 0x602000000010 in
thread T0:
#0 0x7f08b2c80595 in operator delete(void*, unsigned long)
(/usr/lib64/libasan.so.5+0x10d595)
#1 0x4012cb in FSPI::~FSPI()
/home/marxin/Programming/testcases/pr91434.cpp:45
#2 0x4012cb in main /home/marxin/Programming/testcases/pr91434.cpp:54
#3 0x7f08b2694bca in __libc_start_main ../csu/libc-start.c:308
#4 0x4013e9 in _start (/home/marxin/Programming/testcases/a.out+0x4013e9)
0x602000000010 is located 0 bytes inside of 1-byte region
[0x602000000010,0x602000000011)
freed by thread T0 here:
#0 0x7f08b2c80595 in operator delete(void*, unsigned long)
(/usr/lib64/libasan.so.5+0x10d595)
#1 0x4012b4 in main /home/marxin/Programming/testcases/pr91434.cpp:57
previously allocated by thread T0 here:
#0 0x7f08b2c7f10f in operator new(unsigned long)
(/usr/lib64/libasan.so.5+0x10c10f)
#1 0x40126f in main /home/marxin/Programming/testcases/pr91434.cpp:55
SUMMARY: AddressSanitizer: double-free (/usr/lib64/libasan.so.5+0x10d595) in
operator delete(void*, unsigned long)
==11968==ABORTING
More information about the Gcc-bugs
mailing list