Era si cazul

. Multumim !

The g++ 4.8 compiler also has some nice optimizer improvements, most of which are available since g++ 4.7 . Inline functions will be optimized even further if the compiler knows some additional information about function's parameters.
inline int a (int x)
{
if (x < 0)
{
// big code...
}
else
{
// big code...
}
return x;
}
For a(-1) the compiler will write just half of the code now. This feature is great if you inline large functions which are called many times.
Also non-inline functions are optimized.
void f (bool x)
{
if (!x)
// code ...
else
// code ...
}
int main (void)
{
// code...
f(true);
f(false);
f(true);
f(false);
f(true);
f(false);
//code...
}
g++ will now produce two copies of f. One with x being true, while other with x being false. This leads to performance improvements previously possible only by inlining all calls. Cloning causes a lot less code size growth.
A string length optimization pass has been added since g++ 4.7. It attempts to track string lengths and optimize various standard C string functions ( strlen, strchr, strcpy, strcat, stpcpy and so on...).
void x (char *a, char *b, char *c, char *d)
{
strcpy (a, b);
strcat (a, c);
strcat (a, d);
}
becomes
void x (char *a, char *b, char *c, char *d)
{
strcpy (stpcpy (stpcpy (a, b), c), d);
}