Hi,
if we had the following program::
int main()
{
int a, d;
int b=12;
int c=13;
a=b+c;
d=b+c;
return 0;
}
what would gcc produce as a result?
would it be::
fetch b
fetch c
add
store to a
fetch b
fetch c
add
store to b
Or
something more efficient like
fetch b
fetch c
add
store to a
store to b
How can i see the assembly produced by the compiler{if it is possible}?
Where does the compiler makes a better job than the programmer?
From your experience where do you need to employ assembly while programming a real life project...
thanks in advance,
nicolas
PS:: sorry if i am asking a lot of things, but i am really interested in the optimization part of programming,
so plz contribute in every way you can...