Topic : Compiler Optimization

Forum : ARM

Original Post
Post Information Post
May 7, 2011 - 7:02am
Guest

Hello referring to the discussion "strange behavior of debugger using GCC with optimization"
http://forum.raisonance.com/viewtopic.php?id=2694

I am not able to figure out :
1. why the code size decreases when you put the optimization ON?
With optimization the initialization and execution are written separately.
Thus first we copy the argument in say R5 then during the execution in R0 and then do BL
Without optimization the disassembly will directly copy the value in to R0 and BL to the
sub routine.
So the code size without optimization should be lower.

2. How does the factorization help to optimize code?

Thanks in advance

Lokesh Siddhu