From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26336 invoked by alias); 28 Feb 2003 02:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 26321 invoked by uid 71); 28 Feb 2003 02:06:00 -0000 Date: Fri, 28 Feb 2003 02:06:00 -0000 Message-ID: <20030228020600.26320.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Sandor Kovacs Subject: Re: c++/9872: temporary destructor not called? Reply-To: Sandor Kovacs X-SW-Source: 2003-02/txt/msg01469.txt.bz2 List-Id: The following reply was made to PR c++/9872; it has been noted by GNATS. From: Sandor Kovacs To: Wolfgang Bangerth Cc: gcc-bugs@gcc.gnu.org, , Subject: Re: c++/9872: temporary destructor not called? Date: Fri, 28 Feb 2003 01:57:13 +0000 --Boundary-00=_5HsX+OA+17g4atW Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Aha, I've forgatten the attachments, here they come. (Not tgz as the are small though as I can see it looks ugly on the bug report site. Not sure about the std. ways so sending anuway) Sandor --Boundary-00=_5HsX+OA+17g4atW Content-Type: text/x-c++src; charset="iso-8859-1"; name="bug.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug.cpp" /** * Compile: * - to eat up memory: * g++ -c bug.cpp * g++ bug.o -o bug * - work properly: * g++ -fno-elide-constructors -c bug.cpp * g++ bug.o -o bug */ #define ALLOC(N) (char*) new char[sizeof(char)*(N)] #define DELETE(P) delete[] ((char*)(P)) class String { public: String() { data = 0; } String(const char *str) { data = ALLOC(strlen(str) + 1); strcpy(data, str); } String(const String &str){ data = 0; operator=(str.data); } ~String() { if (data) DELETE(data); } String &operator=(const String &str) { return operator=(str.data); } String &operator=(const char *str) { if (data) DELETE(data); if (str) { data = ALLOC(strlen(str) + 1); strcpy(data, str); } else data = 0; return *this; } String &operator+=(const String &str); String &operator+=(const char *str); int length() { return strlen(data); } static int strlen(const char *str); static void strcpy(char *dest, const char *src); protected: char *data; }; String &String::operator+=(const String &str) { return operator+=(str.data); } String &String::operator+=(const char *str) { int len1 = length(), len2 = strlen(str); if (len2) { char *newdata = ALLOC(len1 + len2 + 1); if (data) strcpy(newdata, data); strcpy(newdata + len1, str); if (data) DELETE(data); data = newdata; } return *this; } inline const String operator+(const String &s1, const char *s2) { String tmp(s1); tmp += s2; return tmp; } inline const String operator+(const char *s1, const String &s2) { String tmp(s1); tmp += s2; return tmp; } int String::strlen(const char *str) { if (!str) return 0; const char *org = str; while (*str) str++; return str - org; } void String::strcpy(char *dest, const char *src) { while ((*dest++ = *src++)); } void tester(String str) { } int main(int argc, char** argv) { String str("bug"); while (true) tester("ops: " + str); } --Boundary-00=_5HsX+OA+17g4atW Content-Type: text/x-csrc; charset="iso-8859-1"; name="bug.ii" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug.ii" # 1 "bug.cpp" # 1 "" # 1 "" # 1 "bug.cpp" # 14 "bug.cpp" class String { public: String() { data = 0; } String(const char *str) { data = (char*) new char[sizeof(char)*(strlen(str) + 1)]; strcpy(data, str); } String(const String &str){ data = 0; operator=(str.data); } ~String() { if (data) delete[] ((char*)(data)); } String &operator=(const String &str) { return operator=(str.data); } String &operator=(const char *str) { if (data) delete[] ((char*)(data)); if (str) { data = (char*) new char[sizeof(char)*(strlen(str) + 1)]; strcpy(data, str); } else data = 0; return *this; } String &operator+=(const String &str); String &operator+=(const char *str); int length() { return strlen(data); } static int strlen(const char *str); static void strcpy(char *dest, const char *src); protected: char *data; }; String &String::operator+=(const String &str) { return operator+=(str.data); } String &String::operator+=(const char *str) { int len1 = length(), len2 = strlen(str); if (len2) { char *newdata = (char*) new char[sizeof(char)*(len1 + len2 + 1)]; if (data) strcpy(newdata, data); strcpy(newdata + len1, str); if (data) delete[] ((char*)(data)); data = newdata; } return *this; } inline const String operator+(const String &s1, const char *s2) { String tmp(s1); tmp += s2; return tmp; } inline const String operator+(const char *s1, const String &s2) { String tmp(s1); tmp += s2; return tmp; } int String::strlen(const char *str) { if (!str) return 0; const char *org = str; while (*str) str++; return str - org; } void String::strcpy(char *dest, const char *src) { while ((*dest++ = *src++)); } void tester(String str) { } int main(int argc, char** argv) { String str("bug"); while (true) tester("ops: " + str); } --Boundary-00=_5HsX+OA+17g4atW Content-Type: application/octet-stream; name="bug.with-felide.s" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug.with-felide.s" .file "bug.cpp" .text .align 2 .globl _ZN6StringpLERKS_ .type _ZN6StringpLERKS_,@function _ZN6StringpLERKS_: .LFB1: pushl %ebp .LCFI0: movl %esp, %ebp .LCFI1: subl $8, %esp .LCFI2: subl $8, %esp movl 12(%ebp), %eax pushl (%eax) pushl 8(%ebp) .LCFI3: call _ZN6StringpLEPKc addl $16, %esp leave ret .LFE1: .Lfe1: .size _ZN6StringpLERKS_,.Lfe1-_ZN6StringpLERKS_ .align 2 .globl _ZN6StringpLEPKc .type _ZN6StringpLEPKc,@function _ZN6StringpLEPKc: .LFB2: pushl %ebp .LCFI4: movl %esp, %ebp .LCFI5: subl $24, %esp .LCFI6: subl $12, %esp pushl 8(%ebp) .LCFI7: call _ZN6String6lengthEv addl $16, %esp movl %eax, -4(%ebp) subl $12, %esp pushl 12(%ebp) call _ZN6String6strlenEPKc addl $16, %esp movl %eax, -8(%ebp) cmpl $0, -8(%ebp) je .L3 subl $12, %esp movl -8(%ebp), %eax addl -4(%ebp), %eax incl %eax pushl %eax call _Znaj addl $16, %esp movl %eax, -12(%ebp) movl 8(%ebp), %eax cmpl $0, (%eax) je .L4 subl $8, %esp movl 8(%ebp), %eax pushl (%eax) pushl -12(%ebp) call _ZN6String6strcpyEPcPKc addl $16, %esp .L4: subl $8, %esp pushl 12(%ebp) movl -4(%ebp), %eax addl -12(%ebp), %eax pushl %eax call _ZN6String6strcpyEPcPKc addl $16, %esp movl 8(%ebp), %eax cmpl $0, (%eax) je .L5 movl 8(%ebp), %eax cmpl $0, (%eax) je .L5 subl $12, %esp movl 8(%ebp), %eax pushl (%eax) call _ZdaPv addl $16, %esp .L5: movl 8(%ebp), %edx movl -12(%ebp), %eax movl %eax, (%edx) .L3: movl 8(%ebp), %eax leave ret .LFE2: .Lfe2: .size _ZN6StringpLEPKc,.Lfe2-_ZN6StringpLEPKc .align 2 .globl _ZN6String6strlenEPKc .type _ZN6String6strlenEPKc,@function _ZN6String6strlenEPKc: .LFB3: pushl %ebp .LCFI8: movl %esp, %ebp .LCFI9: subl $8, %esp .LCFI10: cmpl $0, 8(%ebp) jne .L9 movl $0, -8(%ebp) jmp .L8 .L9: movl 8(%ebp), %eax movl %eax, -4(%ebp) .L10: movl 8(%ebp), %eax cmpb $0, (%eax) jne .L12 jmp .L11 .L12: incl 8(%ebp) jmp .L10 .L11: movl -4(%ebp), %eax movl 8(%ebp), %edx subl %eax, %edx movl %edx, %eax movl %eax, -8(%ebp) .L8: movl -8(%ebp), %eax leave ret .LFE3: .Lfe3: .size _ZN6String6strlenEPKc,.Lfe3-_ZN6String6strlenEPKc .align 2 .globl _ZN6String6strcpyEPcPKc .type _ZN6String6strcpyEPcPKc,@function _ZN6String6strcpyEPcPKc: .LFB4: pushl %ebp .LCFI11: movl %esp, %ebp .LCFI12: nop .L14: movl 8(%ebp), %eax movl %eax, %ecx movl 12(%ebp), %eax movb (%eax), %dl movb %dl, (%ecx) leal 12(%ebp), %eax incl (%eax) incl 8(%ebp) testb %dl, %dl jne .L14 popl %ebp ret .LFE4: .Lfe4: .size _ZN6String6strcpyEPcPKc,.Lfe4-_ZN6String6strcpyEPcPKc .align 2 .globl _Z6tester6String .type _Z6tester6String,@function _Z6tester6String: .LFB5: pushl %ebp .LCFI13: movl %esp, %ebp .LCFI14: popl %ebp ret .LFE5: .Lfe5: .size _Z6tester6String,.Lfe5-_Z6tester6String .globl _Unwind_Resume .section .rodata .LC0: .string "bug" .LC1: .string "ops: " .text .align 2 .globl main .type main,@function main: .LFB6: pushl %ebp .LCFI15: movl %esp, %ebp .LCFI16: pushl %ebx .LCFI17: subl $68, %esp .LCFI18: andl $-16, %esp movl $0, %eax subl %eax, %esp subl $8, %esp pushl $.LC0 leal -24(%ebp), %eax pushl %eax .LEHB0: .LCFI19: call _ZN6StringC1EPKc .LEHE0: addl $16, %esp .L19: subl $12, %esp subl $12, %esp leal -56(%ebp), %edx subl $12, %esp leal -24(%ebp), %eax pushl %eax pushl $.LC1 pushl %edx .LEHB1: .LCFI20: call _ZplPKcRK6String .LEHE1: addl $20, %esp leal -56(%ebp), %eax pushl %eax leal -40(%ebp), %eax pushl %eax .LEHB2: .LCFI21: call _ZN6StringC1ERKS_ addl $20, %esp leal -40(%ebp), %eax pushl %eax .LCFI22: call _Z6tester6String addl $16, %esp subl $12, %esp leal -40(%ebp), %eax pushl %eax call _ZN6StringD1Ev .LEHE2: addl $16, %esp jmp .L27 .L34: movl %eax, -60(%ebp) movl -60(%ebp), %ebx subl $12, %esp leal -56(%ebp), %eax pushl %eax call _ZN6StringD1Ev addl $16, %esp movl %ebx, -60(%ebp) jmp .L30 .L27: subl $12, %esp leal -56(%ebp), %eax pushl %eax .LEHB3: call _ZN6StringD1Ev .LEHE3: addl $16, %esp jmp .L19 .L35: movl %eax, -60(%ebp) .L30: movl -60(%ebp), %ebx subl $12, %esp leal -24(%ebp), %eax pushl %eax call _ZN6StringD1Ev addl $16, %esp movl %ebx, -60(%ebp) subl $12, %esp pushl -60(%ebp) .LEHB4: call _Unwind_Resume .LEHE4: .LFE6: .Lfe6: .size main,.Lfe6-main .section .gcc_except_table,"aw",@progbits .LLSDA6: .byte 0xff .byte 0xff .byte 0x1 .uleb128 .LLSDACSE6-.LLSDACSB6 .LLSDACSB6: .uleb128 .LEHB0-.LFB6 .uleb128 .LEHE0-.LEHB0 .uleb128 0x0 .uleb128 0x0 .uleb128 .LEHB1-.LFB6 .uleb128 .LEHE1-.LEHB1 .uleb128 .L35-.LFB6 .uleb128 0x0 .uleb128 .LEHB2-.LFB6 .uleb128 .LEHE2-.LEHB2 .uleb128 .L34-.LFB6 .uleb128 0x0 .uleb128 .LEHB3-.LFB6 .uleb128 .LEHE3-.LEHB3 .uleb128 .L35-.LFB6 .uleb128 0x0 .uleb128 .LEHB4-.LFB6 .uleb128 .LEHE4-.LEHB4 .uleb128 0x0 .uleb128 0x0 .LLSDACSE6: .text .section .gnu.linkonce.t._ZN6StringC1EPKc,"ax",@progbits .align 2 .weak _ZN6StringC1EPKc .type _ZN6StringC1EPKc,@function _ZN6StringC1EPKc: .LFB7: pushl %ebp .LCFI23: movl %esp, %ebp .LCFI24: pushl %ebx .LCFI25: subl $4, %esp .LCFI26: movl 8(%ebp), %ebx subl $12, %esp pushl 12(%ebp) .LCFI27: call _ZN6String6strlenEPKc addl $4, %esp incl %eax pushl %eax .LCFI28: call _Znaj addl $16, %esp movl %eax, (%ebx) subl $8, %esp pushl 12(%ebp) movl 8(%ebp), %eax pushl (%eax) call _ZN6String6strcpyEPcPKc addl $16, %esp movl -4(%ebp), %ebx leave ret .LFE7: .Lfe7: .size _ZN6StringC1EPKc,.Lfe7-_ZN6StringC1EPKc .section .gnu.linkonce.t._ZN6StringC1ERKS_,"ax",@progbits .align 2 .weak _ZN6StringC1ERKS_ .type _ZN6StringC1ERKS_,@function _ZN6StringC1ERKS_: .LFB8: pushl %ebp .LCFI29: movl %esp, %ebp .LCFI30: subl $8, %esp .LCFI31: movl 8(%ebp), %eax movl $0, (%eax) subl $8, %esp movl 12(%ebp), %eax pushl (%eax) pushl 8(%ebp) .LCFI32: call _ZN6StringaSEPKc addl $16, %esp leave ret .LFE8: .Lfe8: .size _ZN6StringC1ERKS_,.Lfe8-_ZN6StringC1ERKS_ .section .gnu.linkonce.t._ZN6StringD1Ev,"ax",@progbits .align 2 .weak _ZN6StringD1Ev .type _ZN6StringD1Ev,@function _ZN6StringD1Ev: .LFB9: pushl %ebp .LCFI33: movl %esp, %ebp .LCFI34: subl $8, %esp .LCFI35: movl 8(%ebp), %eax cmpl $0, (%eax) je .L38 movl 8(%ebp), %eax cmpl $0, (%eax) je .L38 subl $12, %esp movl 8(%ebp), %eax pushl (%eax) .LCFI36: call _ZdaPv addl $16, %esp .L38: leave ret .LFE9: .Lfe9: .size _ZN6StringD1Ev,.Lfe9-_ZN6StringD1Ev .section .gnu.linkonce.t._ZN6String6lengthEv,"ax",@progbits .align 2 .weak _ZN6String6lengthEv .type _ZN6String6lengthEv,@function _ZN6String6lengthEv: .LFB10: pushl %ebp .LCFI37: movl %esp, %ebp .LCFI38: subl $8, %esp .LCFI39: subl $12, %esp movl 8(%ebp), %eax pushl (%eax) .LCFI40: call _ZN6String6strlenEPKc addl $16, %esp leave ret .LFE10: .Lfe10: .size _ZN6String6lengthEv,.Lfe10-_ZN6String6lengthEv .section .gnu.linkonce.t._ZplPKcRK6String,"ax",@progbits .align 2 .weak _ZplPKcRK6String .type _ZplPKcRK6String,@function _ZplPKcRK6String: .LFB11: pushl %ebp .LCFI41: movl %esp, %ebp .LCFI42: pushl %ebx .LCFI43: subl $36, %esp .LCFI44: subl $8, %esp pushl 12(%ebp) leal -24(%ebp), %eax pushl %eax .LEHB5: .LCFI45: call _ZN6StringC1EPKc .LEHE5: addl $16, %esp subl $8, %esp pushl 16(%ebp) leal -24(%ebp), %eax pushl %eax .LEHB6: call _ZN6StringpLERKS_ addl $16, %esp subl $8, %esp leal -24(%ebp), %eax pushl %eax pushl 8(%ebp) call _ZN6StringC1ERKS_ .LEHE6: addl $16, %esp subl $12, %esp leal -24(%ebp), %eax pushl %eax call _ZN6StringD1Ev addl $16, %esp jmp .L45 .L50: movl %eax, -28(%ebp) movl -28(%ebp), %ebx subl $12, %esp leal -24(%ebp), %eax pushl %eax call _ZN6StringD1Ev addl $16, %esp movl %ebx, -28(%ebp) subl $12, %esp pushl -28(%ebp) .LEHB7: call _Unwind_Resume .LEHE7: .L45: movl 8(%ebp), %eax movl -4(%ebp), %ebx leave ret $4 .LFE11: .Lfe11: .size _ZplPKcRK6String,.Lfe11-_ZplPKcRK6String .section .gcc_except_table .LLSDA11: .byte 0xff .byte 0xff .byte 0x1 .uleb128 .LLSDACSE11-.LLSDACSB11 .LLSDACSB11: .uleb128 .LEHB5-.LFB11 .uleb128 .LEHE5-.LEHB5 .uleb128 0x0 .uleb128 0x0 .uleb128 .LEHB6-.LFB11 .uleb128 .LEHE6-.LEHB6 .uleb128 .L50-.LFB11 .uleb128 0x0 .uleb128 .LEHB7-.LFB11 .uleb128 .LEHE7-.LEHB7 .uleb128 0x0 .uleb128 0x0 .LLSDACSE11: .section .gnu.linkonce.t._ZplPKcRK6String .section .gnu.linkonce.t._ZN6StringaSEPKc,"ax",@progbits .align 2 .weak _ZN6StringaSEPKc .type _ZN6StringaSEPKc,@function _ZN6StringaSEPKc: .LFB12: pushl %ebp .LCFI46: movl %esp, %ebp .LCFI47: pushl %ebx .LCFI48: subl $4, %esp .LCFI49: movl 8(%ebp), %eax cmpl $0, (%eax) je .L52 movl 8(%ebp), %eax cmpl $0, (%eax) je .L52 subl $12, %esp movl 8(%ebp), %eax pushl (%eax) .LCFI50: call _ZdaPv addl $16, %esp .L52: cmpl $0, 12(%ebp) je .L55 movl 8(%ebp), %ebx subl $12, %esp pushl 12(%ebp) .LCFI51: call _ZN6String6strlenEPKc addl $4, %esp incl %eax pushl %eax .LCFI52: call _Znaj addl $16, %esp movl %eax, (%ebx) subl $8, %esp pushl 12(%ebp) movl 8(%ebp), %eax pushl (%eax) call _ZN6String6strcpyEPcPKc addl $16, %esp jmp .L56 .L55: movl 8(%ebp), %eax movl $0, (%eax) .L56: movl 8(%ebp), %eax movl -4(%ebp), %ebx leave ret .LFE12: .Lfe12: .size _ZN6StringaSEPKc,.Lfe12-_ZN6StringaSEPKc .section .eh_frame,"aw",@progbits .Lframe1: .long .LECIE1-.LSCIE1 .LSCIE1: .long 0x0 .byte 0x1 .string "zPL" .uleb128 0x1 .sleb128 -4 .byte 0x8 .uleb128 0x6 .byte 0x0 .long __gxx_personality_v0 .byte 0x0 .byte 0xc .uleb128 0x4 .uleb128 0x4 .byte 0x88 .uleb128 0x1 .align 4 .LECIE1: .LSFDE1: .long .LEFDE1-.LASFDE1 .LASFDE1: .long .LASFDE1-.Lframe1 .long .LFB1 .long .LFE1-.LFB1 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI0-.LFB1 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI1-.LCFI0 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI3-.LCFI1 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE1: .LSFDE3: .long .LEFDE3-.LASFDE3 .LASFDE3: .long .LASFDE3-.Lframe1 .long .LFB2 .long .LFE2-.LFB2 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI4-.LFB2 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI5-.LCFI4 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI7-.LCFI5 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE3: .LSFDE11: .long .LEFDE11-.LASFDE11 .LASFDE11: .long .LASFDE11-.Lframe1 .long .LFB6 .long .LFE6-.LFB6 .uleb128 0x4 .long .LLSDA6 .byte 0x4 .long .LCFI15-.LFB6 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI16-.LCFI15 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI18-.LCFI16 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI19-.LCFI18 .byte 0x2e .uleb128 0x10 .byte 0x4 .long .LCFI20-.LCFI19 .byte 0x2e .uleb128 0x18 .byte 0x4 .long .LCFI21-.LCFI20 .byte 0x2e .uleb128 0x14 .byte 0x4 .long .LCFI22-.LCFI21 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE11: .LSFDE13: .long .LEFDE13-.LASFDE13 .LASFDE13: .long .LASFDE13-.Lframe1 .long .LFB7 .long .LFE7-.LFB7 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI23-.LFB7 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI24-.LCFI23 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI26-.LCFI24 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI27-.LCFI26 .byte 0x2e .uleb128 0x4 .byte 0x4 .long .LCFI28-.LCFI27 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE13: .LSFDE15: .long .LEFDE15-.LASFDE15 .LASFDE15: .long .LASFDE15-.Lframe1 .long .LFB8 .long .LFE8-.LFB8 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI29-.LFB8 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI30-.LCFI29 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI32-.LCFI30 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE15: .LSFDE21: .long .LEFDE21-.LASFDE21 .LASFDE21: .long .LASFDE21-.Lframe1 .long .LFB11 .long .LFE11-.LFB11 .uleb128 0x4 .long .LLSDA11 .byte 0x4 .long .LCFI41-.LFB11 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI42-.LCFI41 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI44-.LCFI42 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI45-.LCFI44 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE21: .LSFDE23: .long .LEFDE23-.LASFDE23 .LASFDE23: .long .LASFDE23-.Lframe1 .long .LFB12 .long .LFE12-.LFB12 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI46-.LFB12 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI47-.LCFI46 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI49-.LCFI47 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI50-.LCFI49 .byte 0x2e .uleb128 0x10 .byte 0x4 .long .LCFI51-.LCFI50 .byte 0x2e .uleb128 0x4 .byte 0x4 .long .LCFI52-.LCFI51 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE23: .ident "GCC: (GNU) 3.2" --Boundary-00=_5HsX+OA+17g4atW Content-Type: application/octet-stream; name="bug.without-felide.s" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bug.without-felide.s" .file "bug.cpp" .text .align 2 .globl _ZN6StringpLERKS_ .type _ZN6StringpLERKS_,@function _ZN6StringpLERKS_: .LFB1: pushl %ebp .LCFI0: movl %esp, %ebp .LCFI1: subl $8, %esp .LCFI2: subl $8, %esp movl 12(%ebp), %eax pushl (%eax) pushl 8(%ebp) .LCFI3: call _ZN6StringpLEPKc addl $16, %esp leave ret .LFE1: .Lfe1: .size _ZN6StringpLERKS_,.Lfe1-_ZN6StringpLERKS_ .align 2 .globl _ZN6StringpLEPKc .type _ZN6StringpLEPKc,@function _ZN6StringpLEPKc: .LFB2: pushl %ebp .LCFI4: movl %esp, %ebp .LCFI5: subl $24, %esp .LCFI6: subl $12, %esp pushl 8(%ebp) .LCFI7: call _ZN6String6lengthEv addl $16, %esp movl %eax, -4(%ebp) subl $12, %esp pushl 12(%ebp) call _ZN6String6strlenEPKc addl $16, %esp movl %eax, -8(%ebp) cmpl $0, -8(%ebp) je .L3 subl $12, %esp movl -8(%ebp), %eax addl -4(%ebp), %eax incl %eax pushl %eax call _Znaj addl $16, %esp movl %eax, -12(%ebp) movl 8(%ebp), %eax cmpl $0, (%eax) je .L4 subl $8, %esp movl 8(%ebp), %eax pushl (%eax) pushl -12(%ebp) call _ZN6String6strcpyEPcPKc addl $16, %esp .L4: subl $8, %esp pushl 12(%ebp) movl -4(%ebp), %eax addl -12(%ebp), %eax pushl %eax call _ZN6String6strcpyEPcPKc addl $16, %esp movl 8(%ebp), %eax cmpl $0, (%eax) je .L5 movl 8(%ebp), %eax cmpl $0, (%eax) je .L5 subl $12, %esp movl 8(%ebp), %eax pushl (%eax) call _ZdaPv addl $16, %esp .L5: movl 8(%ebp), %edx movl -12(%ebp), %eax movl %eax, (%edx) .L3: movl 8(%ebp), %eax leave ret .LFE2: .Lfe2: .size _ZN6StringpLEPKc,.Lfe2-_ZN6StringpLEPKc .align 2 .globl _ZN6String6strlenEPKc .type _ZN6String6strlenEPKc,@function _ZN6String6strlenEPKc: .LFB3: pushl %ebp .LCFI8: movl %esp, %ebp .LCFI9: subl $8, %esp .LCFI10: cmpl $0, 8(%ebp) jne .L9 movl $0, -8(%ebp) jmp .L8 .L9: movl 8(%ebp), %eax movl %eax, -4(%ebp) .L10: movl 8(%ebp), %eax cmpb $0, (%eax) jne .L12 jmp .L11 .L12: incl 8(%ebp) jmp .L10 .L11: movl -4(%ebp), %eax movl 8(%ebp), %edx subl %eax, %edx movl %edx, %eax movl %eax, -8(%ebp) .L8: movl -8(%ebp), %eax leave ret .LFE3: .Lfe3: .size _ZN6String6strlenEPKc,.Lfe3-_ZN6String6strlenEPKc .align 2 .globl _ZN6String6strcpyEPcPKc .type _ZN6String6strcpyEPcPKc,@function _ZN6String6strcpyEPcPKc: .LFB4: pushl %ebp .LCFI11: movl %esp, %ebp .LCFI12: nop .L14: movl 8(%ebp), %eax movl %eax, %ecx movl 12(%ebp), %eax movb (%eax), %dl movb %dl, (%ecx) leal 12(%ebp), %eax incl (%eax) incl 8(%ebp) testb %dl, %dl jne .L14 popl %ebp ret .LFE4: .Lfe4: .size _ZN6String6strcpyEPcPKc,.Lfe4-_ZN6String6strcpyEPcPKc .align 2 .globl _Z6tester6String .type _Z6tester6String,@function _Z6tester6String: .LFB5: pushl %ebp .LCFI13: movl %esp, %ebp .LCFI14: popl %ebp ret .LFE5: .Lfe5: .size _Z6tester6String,.Lfe5-_Z6tester6String .globl _Unwind_Resume .section .rodata .LC0: .string "bug" .LC1: .string "ops: " .text .align 2 .globl main .type main,@function main: .LFB6: pushl %ebp .LCFI15: movl %esp, %ebp .LCFI16: pushl %ebx .LCFI17: subl $52, %esp .LCFI18: andl $-16, %esp movl $0, %eax subl %eax, %esp subl $8, %esp pushl $.LC0 leal -24(%ebp), %eax pushl %eax .LEHB0: .LCFI19: call _ZN6StringC1EPKc .LEHE0: addl $16, %esp .L19: leal -40(%ebp), %edx subl $4, %esp leal -24(%ebp), %eax pushl %eax pushl $.LC1 pushl %edx .LEHB1: call _ZplPKcRK6String .LEHE1: addl $12, %esp subl $12, %esp leal -40(%ebp), %eax pushl %eax call _Z6tester6String addl $16, %esp jmp .L19 .L26: movl %eax, -44(%ebp) movl -44(%ebp), %ebx subl $12, %esp leal -24(%ebp), %eax pushl %eax call _ZN6StringD1Ev addl $16, %esp movl %ebx, -44(%ebp) subl $12, %esp pushl -44(%ebp) .LEHB2: call _Unwind_Resume .LEHE2: .LFE6: .Lfe6: .size main,.Lfe6-main .section .gcc_except_table,"aw",@progbits .LLSDA6: .byte 0xff .byte 0xff .byte 0x1 .uleb128 .LLSDACSE6-.LLSDACSB6 .LLSDACSB6: .uleb128 .LEHB0-.LFB6 .uleb128 .LEHE0-.LEHB0 .uleb128 0x0 .uleb128 0x0 .uleb128 .LEHB1-.LFB6 .uleb128 .LEHE1-.LEHB1 .uleb128 .L26-.LFB6 .uleb128 0x0 .uleb128 .LEHB2-.LFB6 .uleb128 .LEHE2-.LEHB2 .uleb128 0x0 .uleb128 0x0 .LLSDACSE6: .text .section .gnu.linkonce.t._ZN6StringC1EPKc,"ax",@progbits .align 2 .weak _ZN6StringC1EPKc .type _ZN6StringC1EPKc,@function _ZN6StringC1EPKc: .LFB7: pushl %ebp .LCFI20: movl %esp, %ebp .LCFI21: pushl %ebx .LCFI22: subl $4, %esp .LCFI23: movl 8(%ebp), %ebx subl $12, %esp pushl 12(%ebp) .LCFI24: call _ZN6String6strlenEPKc addl $4, %esp incl %eax pushl %eax .LCFI25: call _Znaj addl $16, %esp movl %eax, (%ebx) subl $8, %esp pushl 12(%ebp) movl 8(%ebp), %eax pushl (%eax) call _ZN6String6strcpyEPcPKc addl $16, %esp movl -4(%ebp), %ebx leave ret .LFE7: .Lfe7: .size _ZN6StringC1EPKc,.Lfe7-_ZN6StringC1EPKc .section .gnu.linkonce.t._ZN6StringD1Ev,"ax",@progbits .align 2 .weak _ZN6StringD1Ev .type _ZN6StringD1Ev,@function _ZN6StringD1Ev: .LFB8: pushl %ebp .LCFI26: movl %esp, %ebp .LCFI27: subl $8, %esp .LCFI28: movl 8(%ebp), %eax cmpl $0, (%eax) je .L28 movl 8(%ebp), %eax cmpl $0, (%eax) je .L28 subl $12, %esp movl 8(%ebp), %eax pushl (%eax) .LCFI29: call _ZdaPv addl $16, %esp .L28: leave ret .LFE8: .Lfe8: .size _ZN6StringD1Ev,.Lfe8-_ZN6StringD1Ev .section .gnu.linkonce.t._ZN6String6lengthEv,"ax",@progbits .align 2 .weak _ZN6String6lengthEv .type _ZN6String6lengthEv,@function _ZN6String6lengthEv: .LFB9: pushl %ebp .LCFI30: movl %esp, %ebp .LCFI31: subl $8, %esp .LCFI32: subl $12, %esp movl 8(%ebp), %eax pushl (%eax) .LCFI33: call _ZN6String6strlenEPKc addl $16, %esp leave ret .LFE9: .Lfe9: .size _ZN6String6lengthEv,.Lfe9-_ZN6String6lengthEv .section .gnu.linkonce.t._ZplPKcRK6String,"ax",@progbits .align 2 .weak _ZplPKcRK6String .type _ZplPKcRK6String,@function _ZplPKcRK6String: .LFB10: pushl %ebp .LCFI34: movl %esp, %ebp .LCFI35: pushl %ebx .LCFI36: subl $4, %esp .LCFI37: subl $8, %esp pushl 12(%ebp) pushl 8(%ebp) .LEHB3: .LCFI38: call _ZN6StringC1EPKc .LEHE3: addl $16, %esp subl $8, %esp pushl 16(%ebp) pushl 8(%ebp) .LEHB4: call _ZN6StringpLERKS_ .LEHE4: addl $16, %esp jmp .L35 .L40: movl %eax, -8(%ebp) movl -8(%ebp), %ebx subl $12, %esp pushl 8(%ebp) call _ZN6StringD1Ev addl $16, %esp movl %ebx, -8(%ebp) subl $12, %esp pushl -8(%ebp) .LEHB5: call _Unwind_Resume .LEHE5: .L35: movl 8(%ebp), %eax movl -4(%ebp), %ebx leave ret $4 .LFE10: .Lfe10: .size _ZplPKcRK6String,.Lfe10-_ZplPKcRK6String .section .gcc_except_table .LLSDA10: .byte 0xff .byte 0xff .byte 0x1 .uleb128 .LLSDACSE10-.LLSDACSB10 .LLSDACSB10: .uleb128 .LEHB3-.LFB10 .uleb128 .LEHE3-.LEHB3 .uleb128 0x0 .uleb128 0x0 .uleb128 .LEHB4-.LFB10 .uleb128 .LEHE4-.LEHB4 .uleb128 .L40-.LFB10 .uleb128 0x0 .uleb128 .LEHB5-.LFB10 .uleb128 .LEHE5-.LEHB5 .uleb128 0x0 .uleb128 0x0 .LLSDACSE10: .section .gnu.linkonce.t._ZplPKcRK6String .section .eh_frame,"aw",@progbits .Lframe1: .long .LECIE1-.LSCIE1 .LSCIE1: .long 0x0 .byte 0x1 .string "zPL" .uleb128 0x1 .sleb128 -4 .byte 0x8 .uleb128 0x6 .byte 0x0 .long __gxx_personality_v0 .byte 0x0 .byte 0xc .uleb128 0x4 .uleb128 0x4 .byte 0x88 .uleb128 0x1 .align 4 .LECIE1: .LSFDE1: .long .LEFDE1-.LASFDE1 .LASFDE1: .long .LASFDE1-.Lframe1 .long .LFB1 .long .LFE1-.LFB1 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI0-.LFB1 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI1-.LCFI0 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI3-.LCFI1 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE1: .LSFDE3: .long .LEFDE3-.LASFDE3 .LASFDE3: .long .LASFDE3-.Lframe1 .long .LFB2 .long .LFE2-.LFB2 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI4-.LFB2 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI5-.LCFI4 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI7-.LCFI5 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE3: .LSFDE11: .long .LEFDE11-.LASFDE11 .LASFDE11: .long .LASFDE11-.Lframe1 .long .LFB6 .long .LFE6-.LFB6 .uleb128 0x4 .long .LLSDA6 .byte 0x4 .long .LCFI15-.LFB6 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI16-.LCFI15 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI18-.LCFI16 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI19-.LCFI18 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE11: .LSFDE13: .long .LEFDE13-.LASFDE13 .LASFDE13: .long .LASFDE13-.Lframe1 .long .LFB7 .long .LFE7-.LFB7 .uleb128 0x4 .long 0x0 .byte 0x4 .long .LCFI20-.LFB7 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI21-.LCFI20 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI23-.LCFI21 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI24-.LCFI23 .byte 0x2e .uleb128 0x4 .byte 0x4 .long .LCFI25-.LCFI24 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE13: .LSFDE19: .long .LEFDE19-.LASFDE19 .LASFDE19: .long .LASFDE19-.Lframe1 .long .LFB10 .long .LFE10-.LFB10 .uleb128 0x4 .long .LLSDA10 .byte 0x4 .long .LCFI34-.LFB10 .byte 0xe .uleb128 0x8 .byte 0x85 .uleb128 0x2 .byte 0x4 .long .LCFI35-.LCFI34 .byte 0xd .uleb128 0x5 .byte 0x4 .long .LCFI37-.LCFI35 .byte 0x83 .uleb128 0x3 .byte 0x4 .long .LCFI38-.LCFI37 .byte 0x2e .uleb128 0x10 .align 4 .LEFDE19: .ident "GCC: (GNU) 3.2" --Boundary-00=_5HsX+OA+17g4atW--