This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question regarding c++ constructors
- From: Mike Stump <mrs at apple dot com>
- To: mile dot davidovic at micronasnit dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 1 Mar 2005 11:42:17 -0800
- Subject: Re: Question regarding c++ constructors
- References: <200502211159.j1LBxj6N017630@krt.neobee.net>
On Feb 21, 2005, at 3:45 AM, Mile Davidovic wrote:
Functions are completely the same.
What is the reason for such compilere behaviour?
Just lack of code in the compiler to do better, see
http://gcc.gnu.org/ml/gcc-patches/2002-08/msg00354.html for some of the
details and starting point, should you want to develop the code
further.... With that compiler, one can get:
__ZN4testC2Ev:
LFB4:
b __ZN4testC4Ev
LFE4:
.align 2
.globl __ZN4testC1Ev
.section __TEXT,__text,regular,pure_instructions
.align 2
__ZN4testC1Ev:
LFB6:
b __ZN4testC4Ev
LFE6:
.align 2
.globl __ZN4testC4Ev
.section __TEXT,__text,regular,pure_instructions
.align 2
__ZN4testC4Ev:
LFB7:
blr
LFE7:
While this case doesn't show it, imagine if the code were long to very
long, the savings increase.