On Fri, 2007-10-19 at 21:26 +0100, Dominic Kay wrote:
> Do you have any idea what is happening here? Am I missing something
> really obvious? Also I'm a bit queasy about line 3 of the assembler
> output. I can remove lines 3,8-12 and it compiles and runs just fine
> without the extra instructions but if thats systems performance and
> tuning, I'm off to join a rock'n'roll band. 

not sure what compiler you're using but based on ~25 years of reading
other people's compiler output[1] I'm willing to bet you had the
optimizer turned off.  

typically -O1 or -xO1 gets rid of most of the shuffling.  If you turn
"adder" into a static function, SS11's -xO4 reduces the entire program
to:

main:
        movl       $6,%eax                              ;/ line : 11
        ret                                     ;/ line : 11


                                        - Bill

[1] my favorite was the compiler which inserted 

# Don't laugh, it runs

at the end of its assembler output.  

_______________________________________________
perf-discuss mailing list
[email protected]

Reply via email to