This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a question about code optimization


> Here the situation is quite simple. Because a is a template the 
> vector<int>::size() method is probably included in the header files. This 
> means that the compiler can examine or inline the code of the method. If the 
> compiler additionally determines that in /*do something*/ the size is not 

i want to know whether Gcc can determines the size is changed or not...

i did some experiment, and the result is not bad.

anyone can give me some theoritical hints?

> changed, then the optimization is quite straigthforward
> 
> Christoph


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]